Skip to content

Create and manage organizations

Organizations are the foundation of your B2B application, representing your customers and their teams. In Scalekit, organizations serve as multi-tenant containers that isolate user data, configure authentication methods, and manage enterprise features like Single Sign-On (SSO) and directory synchronization.

This guide shows you how to create and manage organizations programmatically and through the Scalekit dashboard.

Users can belong to multiple organizations with the same identity. This is common in products like Notion, where users collaborate across multiple workspaces.

Organizations can be created automatically during user sign-up or programmatically through the API. When users sign up for your application, Scalekit creates a new organization and adds the user to it automatically.

For more control over the organization creation process, create organizations programmatically:

npm install @scalekit-sdk/node

Create organization
const organization = await scalekit.organization.createOrganization('Acme Corporation', {
externalId: 'acme-corp-123',
metadata: {
plan: 'enterprise',
industry: 'technology'
}
});
console.log('Organization created:', organization.id);

External ID: An optional field to associate the organization with an ID from your system. This is useful for linking Scalekit organizations with records in your own database.

Organization administrators often need to make changes after the initial setup. Typical examples include:

  • Renaming the organization after a corporate re-brand.
  • Uploading or replacing the company logo shown on your dashboard or invoices.
  • Storing metadata your application needs at runtime—such as a billing plan identifier, Stripe customer ID, or internal account reference.
Update organization
const updatedOrganization = await scalekit.organization.updateOrganization(
'org_12345',
{
displayName: 'Acme Corporation Ltd',
metadata: {
plan: 'enterprise',
paymentMethod: 'stripe',
customField: 'custom-value'
}
}
);

Metadata: Store additional information about the organization, such as subscription plans, payment methods, or any custom data relevant to your application.

Enable enterprise features for your organizations to support authentication methods like SSO and user provisioning through SCIM.

Enable organization features
const settings = {
features: [
{
name: 'sso',
enabled: true,
},
{
name: 'dir_sync',
enabled: true,
},
],
};
await scalekit.organization.updateOrganizationSettings(
'org_12345',
settings
);

Admin Portal access (self-serve configuration)

Section titled “Admin Portal access (self-serve configuration)”

Enterprise customers usually want to manage SSO and directory sync on their own, without involving your support team. Scalekit provides an Admin Portal that you can surface to IT administrators in two ways:

  1. Generate a shareable link and send it via email or chat.
  2. Embed the portal inside your own settings page with an <iframe>.

Both approaches give administrators a sandboxed interface to configure SSO (SAML/OIDC) connections, SCIM provisioning, and other security settings.

Generate Admin Portal link
const portalLink = await scalekit.organization.generatePortalLink('org_12345');
// Present this URL to the organization's IT admin or load it in an iframe
console.log('Admin Portal URL:', portalLink.url);

For advanced customization options, see the Admin Portal guide.

As an alternative to the Admin Portal, you can configure SSO and SCIM directly from the Scalekit dashboard. This approach is useful when you want to set up these features for your customers without sharing admin portal access.

Configure Single Sign-On to connect your customer’s identity provider with Scalekit. From the organization’s settings page in the dashboard, you can set up SSO connections.

To configure SSO:

  1. Configure user attributes by mapping attributes from the identity provider to user profiles in Scalekit.
  2. Enter identity provider configuration with metadata from your customer’s IdP, including Entity ID, ACS URL, and X.509 certificate.
  3. Assign users and groups to specify which users and groups can use this SSO connection.
  4. Test SSO by performing a test login to ensure the connection works correctly.
  5. Enable connection once you’ve verified the configuration is working.

For step-by-step guides on configuring specific identity providers, see SSO integrations.

Configure SCIM provisioning to allow your customers to provision and manage users and groups automatically from their directory provider.

To set up SCIM:

  1. Generate SCIM endpoint and provide this URL to your customer for configuration in their directory provider.
  2. Create bearer token and share this rotatable token with your customer for secure authentication.
  3. Monitor synced users and groups to verify which users and groups are being synced after the connection is active.

For detailed configuration guides with specific providers, see SCIM integrations to automate user and group management.

Configure advanced authentication and access control policies to meet your organization’s security requirements.

Authentication methods Coming soon

Section titled “Authentication methods ”

Organization admins will be able to configure which authentication methods are available to their organization members. For example, they can restrict access to only enterprise SSO for enhanced security, or allow a combination of SSO and passwordless authentication for flexible user access.

Session settings Coming soon

Section titled “Session settings ”

Organization admins will be able to configure session settings for all their organization members. They can set session timeout, idle timeout, and other session-related settings that align with their organization’s security policies and compliance requirements.