Docs

Organization metadata

Caution

This guide is for users who want to build a custom user interface using the Clerk API. To create organizations using a prebuilt UI, you should use the prebuilt components.

Organization metadata allows you to store information about an organization that is not part of the standard fields, such as custom attributes that are specific to your application.

There are two types of metadata: public and private.

  • Both public and private metadata are set and can be accessed from the Backend API.
  • Only public metadata can be accessed from the Frontend API.

Both the Organization and Organization Membership objects have the metadata fields: publicMetadata and privateMetadata.

  • Use the publicMetadata property if you need to set some metadata from your backend and have them displayed as read-only on the frontend.
  • Use the privateMetadata property if the custom attributes contain sensitive information that should not be displayed on the frontend.

Set organization metadata

To ease the flow of setting metadata, Clerk provides the updateOrganizationMetadata() and updateOrganizationMembershipMetadata() methods from the Backend SDK, which is a wrapper around the Backend API.

Warning

Metadata is limited to 8kb maximum.

Feedback

What did you think of this content?

Last updated on