Custom User Data
How to store custom user metadata in Stack Auth
Stack Auth allows storing additional user information through three types of metadata fields:
- clientMetadata: Readable and writable on the client-side.
- serverMetadata: Readable and writable only on the server-side.
- clientReadOnlyMetadata: Readable on the client-side, writable only on the server-side.
Client-side metadata
You can use the clientMetadata
field to store non-sensitive information that both the client and server can read and write.
Server-side metadata
For sensitive information, use the serverMetadata
field. This ensures the data is only accessible and modifiable by the server.
Client read-only metadata
Use clientReadOnlyMetadata
for data that clients need to read but should not modify, such as subscription status.