Organization methods
These are all methods on the Clerk class that allow you to create, modify, or read information about Organizations.
getOrganization()
function getOrganization(organizationId: string): Promise<Organization | undefined>;
The getOrganization
method is used to get the information of an organization programatically.
Properties
Name | Type | Description |
---|---|---|
organizationId | string | The ID of the organization to be found. |
Returns
Type | Description |
---|---|
Promise<Organization | undefined> | This method returns a Promise which resolves to the requested Organization . |
createOrganization()
function createOrganization({name, slug}: CreateOrganizationParams): Promise<Organization>;
The createOrganization
method is used to create an organization programatically.
Properties
Name | Type | Description |
---|---|---|
name | string | The name of the organization to be created. |
slug? | string | The optional slug of the organization to be created. |
Returns
Type | Description |
---|---|
Promise<[Organization][org-ref> | This method returns a Promise which resolves to the newly created Organization . |
getOrganizationMemberships()
function getOrganizationMemberships(): Promise<OrganizationMembership[]>;
Get a list of all organizations your current user is a part of in the form of an array of OrganizationMembership
s.
Returns
Type | Description |
---|---|
Promise<OrganizationMembership[]> | This method returns a Promise which resolves to the list of OrganizationMembership s for the current user. |