Self-hosted authentication
Set two environment variables when starting the server:Backend-first: choose
UPNEXT_BACKEND before startup. This example uses sqlite.UPNEXT_API_KEY becomes the one bearer token accepted by the self-hosted runtime.
How it works
When self-hosted authentication is enabled:- Every request to
/api/v1/*must include anAuthorization: Bearer <key>header - The runtime compares the provided token to
UPNEXT_API_KEY - If the token matches, the request proceeds
- If the token is missing or invalid, the server returns
401
Connect workers and APIs
Workers and APIs need the same self-hosted token to report to the dashboard. SetUPNEXT_API_KEY alongside UPNEXT_URL:
Verify a key
Check if a key is valid without performing any action:200 with the resolved workspace scope if valid, 401 if invalid.
Check auth status
Check whether the server has authentication enabled (no key required):Environment variables
| Variable | Default | Description |
|---|---|---|
UPNEXT_AUTH_ENABLED | false | Enable the self-hosted bearer-token gate |
UPNEXT_API_KEY | — | Static bearer token for self-hosted auth |