Skip to main content
Bludia uses two layers of credentials:
  1. API key: identifies your app. Sent on every request as X-BLUDIA-API-KEY.
  2. Access token: identifies the signed-in end user. Sent as Authorization: Bearer <token> when the key’s auth type is end_users.

Choose a key type

platform

For trusted servers only.
  • API key alone is enough.
  • Full read/write access to every collection.
  • Role permissions and row policies don’t apply.
  • Use for back-office scripts, data sync, and server-side rendering.

end_users

For browser and mobile apps.
  • API key + end user’s Bearer token on data routes.
  • Role permissions and row policies apply.
  • Login, register, and password routes work with the key alone.
  • Safe to ship in client code when combined with allowed origins.

Platform key request

Never put a platform key in frontend code, a mobile app bundle, or a public repository. Anyone with it can read and change all project data.

End-user request

1

Log the user in

2

Call the API as that user

3

Refresh before it expires

Access tokens last expires_in seconds (15 minutes by default). Use the refresh token to get a new pair. See Sessions & tokens.

How a request is checked

Access token contents

Access tokens are JWTs signed with HS256. Their payload includes:
Roles are copied into the token at login. Bludia checks the user’s current roles on each request, but refresh the session after changing roles so your client sees up-to-date claims.