Organization domain methods
These methods on the Organization
object allow you to manage the domains of an organization.
The following examples assume:
- you have followed the quickstart in order to add Clerk to your JavaScript application
- you have enabled the Organizations feature in your Clerk Dashboard
- you have enabled Verified domains for your organization
createDomain()
Creates a new domain for the currently active organization.
- Name
domainName
- Type
string
- Description
The domain name that will be added to the organization.
Returns
Type | Description |
---|---|
Promise<OrganizationDomain> | This method returns a Promise that resolves to the OrganizationDomain for the corresponding ID. |
Example
getDomains()
Retrieves the list of domains for the currently active organization.
- Name
initialPage?
- Type
number
- Description
A number that can be used to skip the first n-1 pages. For example, if
initialPage
is set to 10, it is will skip the first 9 pages and will fetch the 10th page.
- Name
pageSize?
- Type
number
- Description
A number that indicates the maximum number of results that should be returned for a specific page.
- Name
enrollmentMode?
- Type
'manual_invitation' | 'automatic_invitation' | 'automatic_suggestion'
- Description
An enrollment mode will change how new users join an organization.
Returns
Type | Description |
---|---|
Promise<ClerkPaginatedResponse<OrganizationDomain>> | This method returns a Promise that resolves to a ClerkPaginatedResponse of OrganizationDomain objects. |
Example
getDomain()
Retrieves a domain for an organization based on the given domain ID.
- Name
domainId
- Type
- string
- Description
The ID of the domain that will be fetched.
Returns
Type | Description |
---|---|
Promise<OrganizationDomain> | This method returns a Promise that resolves to the OrganizationDomain for the corresponding ID. |
Example
Feedback
Last updated on