X-Gallery-Token on every request.
Generating a token
A token looks like a 64-character hex string:
Using the token
Pass it tocreateFramalabClient at initialization:
Store both values as environment variables.
.env.local
client.ts
X-Gallery-Token: <token> to every request automatically.
Storing the token
Treat gallery tokens like API keys — do not commit them to source control.
| Stack | Recommended storage |
|---|---|
| Next.js | .env.local / Vercel environment variables |
| Astro | .env / platform environment variables |
| Docker | Secrets or runtime env injection |
| Netlify / Cloudflare Pages | Platform environment variables |
Token lifecycle
| Property | Behavior |
|---|---|
| Scope | Bound to a single project |
| Expiration | Optional expiresAt. Expired tokens return 401. |
| Revocation | Can be revoked from the panel at any time |
| Multiple tokens | A project can have multiple active tokens simultaneously |
Error when the token is invalid
401. See Error Handling for how to catch this in code.