Local development
Plain http://localhost cannot sign in to the
production instance — the origin is rejected, and even allowlisted,
browsers drop the session cookie as cross-site (symptom: email accepted, password
accepted, then “you are signed out”). Two working paths:
1 · Default: develop against the DEV environment. The dev
Clerk instance has no origin restriction — plain localhost on any port works
with zero setup, macOS and Windows alike, against the dev branch’s sample
data. Switch this hub to DEV (the topbar chip) and the starter prompt embeds the
dev keys; build apps with the environment as one config swap.
2 · Production-shape testing: the shared origin
https://dev.digitaldoka.com:8443 is allowlisted
(exact port — a different port is a different origin). One-time, per machine:
Setup commands (macOS & Windows, incl. static-HTML apps)
# 1. Point the subdomain at your machine
# macOS / Linux:
sudo sh -c 'echo "127.0.0.1 dev.digitaldoka.com" >> /etc/hosts'
# Windows — PowerShell AS ADMINISTRATOR:
Add-Content -Path $env:SystemRoot\System32\drivers\etc\hosts -Value "127.0.0.1 dev.digitaldoka.com"
# 2. Trusted local certificate (mkcert: brew install mkcert / winget install FiloSottile.mkcert)
mkcert -install
mkcert dev.digitaldoka.com
# 3. Serve YOUR app over HTTPS on 8443 — static HTML needs no build step:
npx http-server . -S -C dev.digitaldoka.com.pem -K dev.digitaldoka.com-key.pem -p 8443
# (Vite: server.https · Next: --experimental-https · keep certs out of git)
Never edit Clerk’s allowed_origins
yourself — the Backend API PATCH replaces the whole list and would
remove everyone else’s origins; the platform owner maintains it. And hosted
previews on bare *.netlify.app URLs fail on the same
cross-site cookies as localhost — production deployments need a real
digitaldoka.com subdomain (one CNAME).
The generated starter prompts carry this section with the live dev
keys and the failure-symptom table baked in.