Back to home
Sua Pa AI — Setup diagnostics
Configure two things — NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY — and Sua Pa AI runs.
Overall status
✗ Cannot reach Supabase
NEXT_PUBLIC_SUPABASE_URL / NEXT_PUBLIC_SUPABASE_ANON_KEY not set.
Open .env, paste your Supabase project URL and anon key, then restart the dev server.
The 30-second fix
Paste your Project URL and anon key
- Open your Supabase project → Project Settings → API.
- Copy the Project URL and the anon / public key.
- Open .env and set them as NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY.
- Make sure the schema has been created — run docs/supabase-schema.sql in the SQL Editor once (see below).
- Stop the dev server (Ctrl+C) and run npm run dev again.
# .env — the two lines you actually need NEXT_PUBLIC_SUPABASE_URL=https://xxxxxxxxxxxxx.supabase.co NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJ... # Optional extras: # OPENAI_API_KEY=sk-... # SUPABASE_SERVICE_ROLE_KEY=eyJ...
Tables aren't created automatically — paste the contents of docs/supabase-schema.sql into the Supabase SQL Editor and click Run once, then reload this page.
Environment variables
- NEXT_PUBLIC_SUPABASE_URLrequired
set
- NEXT_PUBLIC_SUPABASE_ANON_KEYrequired
not set — required
- OPENAI_API_KEY
set
- SUPABASE_SERVICE_ROLE_KEY
set
Likely fixes for your error
- 1Double-check NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY, then restart the dev server.
Full instructions in docs/SUPABASE.md.