Allowed email domains for organization auto-join
Define trusted email domains for an organization to allow user to directly join an workspace
Allowed email domains lets organization admins define trusted domains for their organization. When a user signs in or signs up with a matching email domain, Scalekit suggests the user to join that organization in the organization switcher so the user can join the organization with one click. This feature is authentication-method agnostic: regardless of whether a user authenticates via SSO, social login, or passwordless authentication, organization options are suggested based on their email domain.
When a user signs up or signs in, Scalekit will automatically:
- Match email domains - Check if the user’s email domain matches configured allowed domains for any organization.
- Suggest organization options - Show the user available organizations they can join through an organization switcher.
- Enable user choice - Allow users to decide which of the suggested organizations they want to join.
- Create organization membership - Automatically add the user to their selected organization.
Manage allowed email domains in Scalekit Dashboard
Section titled “Manage allowed email domains in Scalekit Dashboard”Allowed email domains can be configured for an organization through the Scalekit Dashboard.
Manage allowed email domains API
Section titled “Manage allowed email domains ”Configure allowed email domains for an organization programmatically through the Scalekit API. Before proceeding, complete the steps in the installation guide.
# 1. Register an allowed email domain# Use case: Restrict user registration to specific company domains for B2B applicationscurl 'https://<SCALEKIT_ENVIRONMENT_URL>/api/v1/organizations/{organization_id}/domains' \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "domain": "customerdomain.com", "domain_type": "ALLOWED_EMAIL_DOMAIN"}'
# 2. List all registered allowed email domains# Use case: Display domain restrictions in admin dashboard or verify current settingscurl 'https://<SCALEKIT_ENVIRONMENT_URL>/api/v1/organizations/{organization_id}/domains'
# 3. Get details of a specific domain# Use case: Verify domain configuration or retrieve domain metadatacurl 'https://<SCALEKIT_ENVIRONMENT_URL>/api/v1/organizations/{organization_id}/domains/{domain_id}'
# 4. Delete an allowed email domain# Use case: Remove domain restrictions or clean up unused configurationscurl 'https://<SCALEKIT_ENVIRONMENT_URL>/api/v1/organizations/{organization_id}/domains/{domain_id}' \ --request DELETE// 1. Register an allowed email domain// Use case: Restrict user registration to specific company domains for B2B applicationsconst newDomain = await scalekit.createDomain("org-123", "customerdomain.com", { domainType: "ALLOWED_EMAIL_DOMAIN",});
// 2. List all registered allowed email domains// Use case: Display domain restrictions in admin dashboard or verify current settingsconst domains = await client.domain.listDomains(organizationId);
// 3. Get details of a specific domain// Use case: Verify domain configuration or retrieve domain metadataconst domain = await client.domain.getDomain(organizationId, domainId);
// 4. Delete an allowed email domain// Use case: Remove domain restrictions or clean up unused configurations// Caution: Deletion is permanent and may affect user accessawait client.domain.deleteDomain(organizationId, domainId);