SDK Management
If you wish to learn more about Tenants, check out our Tenants Overview doc.
Descope admins can create and update tenants either manually in the Descope console, using the Tenant Management APIs, or using the SDK as shown below.
Tenant management using the management SDK
Install SDK
Import and initialize Management SDK
Load All tenants
Use the code below to load all existing tenants within the project
Load Tenant by ID
This function allows for you to load a specific tenant based on the tenant's ID.
Search Tenants
This function allows for you to search Descope tenants by ID, name, self service provisioning domain, and custom attributes.
Create Tenant
At the time of creation, the tenant must be given a name and a tenant-id. If you don't provide a tenant-id, a tenant-id is automatically generated. The tenant-id is used for sign-up/sign-in and other management operations later. In addition, you can also set domains for the tenant. The domain is used to automatically assign the end-user to a tenant at the time of sign-up and sign-in. The tenant name must be unique per project. The tenant ID is generated automatically for the tenant when not provided.
Update Tenant
Use the code below to update an existing tenant with the given name and domains. All parameters are used as overrides to the existing tenant. Empty fields will override populated fields.
Delete Tenant
Use the code below to delete an existing tenant. Please note that this action is irreversible.
Update Tenant Password Policy
Use the code below to update password policy for your tenant.
Get and Update Tenant Settings
Use the getSettings
and configureSettings
functions as shown below to access and update settings for your tenant, based on the tenant ID.