Operate

Local development

Running against the development API, localhost callbacks and test keys.

Setup#

Use your project's development environment: its users, keys and settings are separate from production's.

.env.local

AUTH_CLIENT_ID=client_…            # development environment
AUTH_API_KEY=sk_…                  # server only; never commit it
AUTH_API_URL=https://authentication-api-dev.3een.app
NEXT_PUBLIC_AUTH_REDIRECT_URI=http://localhost:3000/dashboard

Localhost callbacks#

Register http://localhost:3000/api/auth/callback (or your Express callback route) as a redirect URI of the development environment. The code handoff checks the exact URL, port included.

Cookies on localhost#

Session cookies are Secure only when NODE_ENV=production, so sign-in works over plain http://localhost. Cloudflare Turnstile does not run on localhost, and webhook endpoints may use http:// there.