Install the API
Run the Laydebug Hono API with PGlite locally or Postgres in production.
Local
pnpm install
cp apps/api/.env.example apps/api/.env
# set LAYDEBUG_PROJECT_API_KEY, BETTER_AUTH_SECRET, ALLOW_INSECURE_LOCAL_ADAPTERS=true
pnpm --filter @laydebug/api devPGlite is used when DATABASE_URL is unset and ALLOW_INSECURE_LOCAL_ADAPTERS=true.
Production
- Apply
supabase/migrations/0001_init.sql. - Keep bucket
laydebug-stateprivate. - Set
DATABASE_URL,SUPABASE_URL,SUPABASE_SECRET_KEY,BETTER_AUTH_SECRET,BETTER_AUTH_URL. - Set
GITHUB_ISSUE_TOKENandGITHUB_REPOso reports open issues. - Set
LAYDEBUG_PROJECT_API_KEYonce; the API stores only the SHA-256 hash.
v1 report auth is the hashed project API key (x-laydebug-key). Better Auth with GitHub OAuth is mounted at /api/auth so a later console can mint keys without a schema break.
Frozen procedures: health.check, reports.prepareStateUpload, reports.bug.