Skip to Content
Clerk logo

Clerk Docs

Ctrl + K
Go to clerkstage.dev

OrganizationMembership

The OrganizationMembership object is the model around an organization membership entity and describes the relationship between users and organizations.

Properties

NameTypeDescription
idstringA unique identifier for this organization membership.
publicMetadataobjectCustom metadata that are visible to the frontend.
rolestringThe role of the current user in the organization.
publicUserDataPublicUserDataPublic information about the user that this membership belongs to.
organizationOrganizationThe Organization object the membership belongs to.
createdAtDateDate of the time the membership was created.
updatedAtDateDate of the last time the membership was updated.

Methods

destroy()

function destroy(): Promise<OrganizationMembership>;

Deletes the membership from the organization it belongs to.

Returns

TypeDescription
Promise<OrganizationMembership>This method returns a Promise which resolves to the OrganizationMembership for the deleted membership.

update()

function update(updateParams: UpdateOrganizationMembershipParams): Promise<OrganizationMembership>;

Updates the member's role.

UpdateOrganizationMembershipParams

NameTypeDescription
rolestringThe role of the new member.

Returns

TypeDescription
Promise<OrganizationMembership>This method returns a Promise which resolves to the OrganizationMembership for the updated membership.

What did you think of this content?

Clerk © 2024