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 from a client.
- serverMetadata: Readable and writable only from a server.
- clientReadOnlyMetadata: Readable from a client, writable only from a server.
Client 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 never modify, such as subscription status.