Clerk logo

Clerk Docs

Ctrl + K
Go to clerkstage.dev
Check out a preview of our new docs.

Organization Metadata

Organization objects hold a set of metadata that can be used internally to store arbitrary information.

Overview

Metadata allows for custom data to be saved on the Organization object, Organization Invitation object, and Organization Membership object. There are two types of metadata: "public", and "private." Choosing which metadata field you should use for setting custom attributes on your organizations becomes a matter of access and visibility.

Metadata Frontend API Backend API
private - Read/Write
public Read Read/Write

Please note that Organization Invitations can only include public metadata.

Metadata is limited to 8kb maximum.

Backend metadata

Both public and private metadata are set from the Backend API, but public metadata can be accessed from the Frontend API and Backend API. These types of metadata can be used to access non-sensitive information about an organization, such as their profile picture or their name. They can be used to build UIs where an organization might not be signed in, but you still want to show some of their profile info.

Organization Metadata

Public metadata

The publicMetadata property should be used if you need to set some metadata from your back-end and have them displayed as read-only on the front-end.

const updateOrg = await organizations.updateOrganizationMetadata(OrgID,{publicMetadata})

Private metadata

The privateMetadata property should be used if custom attributes contain sensitive information that should not be displayed on the front-end.

const updateOrg = await organizations.updateOrganizationMetadata(OrgID,{privateMetadata})

Organization Membership Metadata

Public metadata

The publicMetadata property should be used if you need to set some metadata from your back-end and have them displayed as read-only on the front-end.

const updateOrg = await organizations.updateOrganizationMembershipMetadata(OrgID,{publicMetadata})

Private metadata

The privateMetadata property should be used if custom attributes contain sensitive information that should not be displayed on the front-end.

const updateOrg = await organizations.updateOrganizationMembershipMetadata(OrgID,{privateMetadata})

Organization Invitation Metadata

Public metadata

The publicMetadata property should be used if you need to set some metadata from your back-end and have them displayed as read-only on the front-end.

const updateOrg = await organizations.updateOrganizationInvitationMetadata(OrgID,{publicMetadata})

Was this helpful?

Clerk © 2023