Session-based authentication (web app)
When you sign in through the Entri web application, BetterAuth creates a cookie-based session. All requests made from the browser automatically include this session cookie, so no additional setup is required for web app usage. Session authentication supports:- Email + password sign-in
- OAuth via Google or GitHub
API token authentication (programmatic access)
For programmatic access — such as from the CLI, CI/CD pipelines, or your own integrations — use API tokens. API tokens are passed via theX-API-Key request header:
entri_.
Example: curl
Example: JavaScript fetch
Example: CLI
The CLI handles token storage and injection automatically. After runningnt3 login, the token is stored locally and attached to every outgoing request:
NT3_API_TOKEN environment variable, which takes priority over stored credentials:
Token priority order
When the CLI determines which token to use, it checks sources in this order:NT3_API_TOKENenvironment variable (highest priority).nt3.local.jsonin the current directory (folder-scoped)~/.nt3/config.json(global)
Security recommendations
- Never commit API tokens to source control
- Store tokens in environment variables or a secrets manager in CI/CD
- Use short-lived or project-scoped tokens where possible
- Run
nt3 statusto confirm which token is currently active
The GraphQL API at
/graphql also supports API token authentication via the same X-API-Key header.