GatelitClient calls getToken() before every request. What that function returns determines how the gateway identifies and authorizes the request. Three schemes are available — pick the right one for your deployment.
Service keys (GatelitKey)
Long-lived keys for backend use. Create them in the dashboard under Settings → Service Keys.
Signed tokens (GatelitSigned)
Your backend issues short-lived HMAC-signed JWTs. The gateway verifies them without a database call.
Backend — Nuxt server route example:
GATELIT_SIGNING_SECRET must match between your backend and the gateway.
Both sign and verify with the same secret.OIDC tokens (Bearer)
OIDC authentication is in Alpha. Full self-serve configuration is coming soon.
Contact us if you need OIDC support today.
Caching tokens
getToken is called before every request. Add caching to avoid unnecessary work: