Organization metadata
Organization metadata lets you store custom information about an organization that is not part of the standard fields, such as custom attributes that are specific to your application. This is useful for advanced user segmentation, analytics, or storing application-specific data like subscription tier, department, or region.
There are two types of metadata: public and private.
- You can set both public and private metadata and access them from the Backend API.
- You can access only public metadata from the Frontend API.
Both the Organization and Organization Membership objects have the metadata fields: publicMetadata and privateMetadata.
- Use the
publicMetadataproperty if you need to set some metadata from your backend and have them displayed as read-only on the frontend. - Use the
privateMetadataproperty if the custom attributes contain sensitive information that should not be displayed on the frontend.
Set organization metadata
You can set organization metadata in the Clerk dashboard or using the JS Backend SDK.
Clerk Dashboard
- In the Clerk Dashboard, navigate to the Organizations page.
- Select the organization you want to update.
- In the Organization metadata section, select Edit next to the metadata you want to update.
JS Backend SDK
To ease the flow of setting metadata, Clerk provides the updateOrganizationMetadata() and updateOrganizationMembershipMetadata() methods from the JS Backend, which is a wrapper around the Backend API.
Next steps
Now that you understand organization metadata, you can:
- Use organization slugs in URLs for tenant-specific routing
- Add metadata to invitations to track invitation sources or assign attributes
- Create and manage organizations to see metadata in action
- Check roles and permissions to control access based on metadata values
Feedback
Last updated on