Organization
This is a class that represents an organization. It's returned from the createOrganization
and getOrganization
methods on the Clerk
class instance.
Properties
Name | Type | Description |
---|---|---|
id | string | The unique identifier of the related organization. |
name | string | The name of the related organization. |
slug | string | null | The organization slug. If supplied, it must be unique for the instance. |
logoUrl | string | null | The full URL for the organization logo. (deprecated in favor of imageUrl) |
imageUrl | string | Holds the organization logo or default logo |
membersCount | number | The number of members the associated organization contains |
pendingInvitationsCount | number | The number of pending invitations to users to join the organization. |
publicMetadata | object | Additional information about the organization that can be read through the Frontend API, but written only from the Backend API. |
createdAt | Date | Date of the time the organization was created. |
updatedAt | Date | Date of the last time the user was updated. |
Methods
update()
function update(params: UpdateOrganizationParams): Promise<Organization>;
Updates an organization's attributes.
UpdateOrganizationParams
Name | Type | Description |
---|---|---|
name | string | The organization name. |
slug | string | undefined | The organization slug. |
Returns
Type | Description |
---|---|
Promise<Organization> | This method returns a Promise which resolves to an Organization. |
destroy()
function destroy(): Promise<void>;
Deletes the organization. Only administrators can delete an organization.
Please note that deleting an organization will also delete all memberships and invitations. This is not reversible.
Returns
Type | Description |
---|---|
Promise<void> | This method returns a Promise which doesn't resolve to any value. |
setLogo()
function setLogo(params: SetOrganizationLogoParams): Promise<Organization>;
Sets or replaces an organization's logo. Accept the logo as a file or blob. The logo must be an image and its size cannot exceed 10MB.
SetOrganizationLogoParams
Name | Type | Description |
---|---|---|
file | File | Blob | null | An image file which cannot exceed 10MB. Passing null will delete the organization's current logo. |
Returns
Type | Description |
---|---|
Promise<Organization> | This method returns a Promise which resolves to an Organization. |
Additional methods
In addition to the methods listed above, the Organization
class also has the following methods: