Keys and access
Keys
Fox Login has three kinds of keys. The publishable key goes into your frontend. Secret keys and organization API keys stay on your servers.
Publishable key
A publishable key looks like pk_live_eu_… or pk_live_tr_…. Each application has exactly one. It is on the application's Quick start and API keys & webhooks pages in the dashboard, and in the publishable_key field of the application object.
The SDK reads the region from the key and calls that region's host, for example https://eu.auth.foxlogin.app, with the key in the X-Fox-Publishable-Key header. The key lets anyone start a sign-up or sign-in for your application. It cannot read users, change settings or call the Management API, so it is safe in a browser or mobile app.
Secret key
A secret key looks like sk_live_eu_… or sk_live_tr_… and belongs to one application. It calls the Management API at https://api.foxlogin.app/v1 for that application only, within the scopes of its role: admin, editor or viewer.
Every application starts with one secret key, named Default, with the admin role. Organization owners and admins can create more on the application's API keys & webhooks page. The dashboard shows a new key in full once; Fox Login stores only a hash of it. Afterwards you see its prefix, the first 15 characters, such as sk_live_eu_Ab3d….
Send it as a Bearer token:
GET /v1/applications/app_8f2c91a7/users/usr_eu_8f2c91a7 HTTP/1.1
Host: api.foxlogin.app
Authorization: Bearer sk_live_eu_…Organization API key
An organization API key looks like fk_live_…. It reaches every application of the organization, including ones created later, and it can create applications. Owners and admins create these keys on the API access page in the dashboard sidebar. Its prefix is the first 12 characters, such as fk_live_8f2c. See Organization API keys.
Which key to use
| Task | Key |
|---|---|
| Sign users up or in from a browser or app | Publishable key |
| Verify session tokens on your backend | None. The public keys at /.well-known/jwks.json are enough. |
| Read or create users of one application from your backend | Secret key with the editor or admin role |
| Read users and events for reports | Secret key with the viewer role |
| Create or delete webhook endpoints of one application | Secret key with the admin role |
| Create applications from a script or CI job | Organization API key |
| Work with several applications from one service | Organization API key |
| Create or revoke secret keys | The dashboard as an organization owner or admin, or an organization API key with keys:write |
Environment variables
The SDK examples in these docs read the keys from these variables:
# Frontend: bundled into your app, public by design
FOXLOGIN_PUBLISHABLE_KEY=pk_live_eu_…
# Backend only: never bundle these
FOXLOGIN_SECRET_KEY=sk_live_eu_…
FOXLOGIN_APP_ID=app_…
FOXLOGIN_API_KEY=fk_live_… # only where you need an organization keyRotation, revoking and security covers how to keep these keys safe.