Supabase connection guide for SWARLY
Use this guide when connecting a project in SWARLY → Dashboard → Project → Settings → Supabase keys. All values must come from the same Supabase project.
Quickstart (2-3 minutes)
- Copy Project URL (https://<project-ref>.supabase.co) from Supabase Project Overview.
- Copy anon/public key from Project Settings -> API Keys.
- Copy service_role key from Project Settings -> API Keys.
- In SWARLY click Save, then Test connection. Add DB password/pooler only when you need Postgres checks.
Strict mode: Save requires valid API credentials from the same Supabase project. Keep all copied values from one project only.
What each value is for (quick mental model)
- Project URL + Anon key — Supabase REST / client-style API access.
- Service role key — server-side operations; bypasses Row Level Security (keep secret).
- Database password — login for the postgres user (schema tools, SQL path).
- Postgres pooler host — IPv4-friendly hostname when direct db.* is unreachable from your host (e.g. some serverless regions).
Where things live in the Supabase UI
In the Supabase dashboard, the left sidebar is the main map. You will use:
- Project Overview (home for your project) — Project URL is shown at the top; the same URL often appears under Project Settings → API Keys.
- Project Settings (gear) → API Keys — anon / public (publishable) JWT and service_role secret key.
- Project Settings → Database — database password and connection info.
- Connect (button near the top of the project, or under Database depending on layout) — Session pooler host string.
Supabase occasionally moves labels; if a name differs slightly, look for the same concepts (API keys, Database password, Connection / Pooler).
Field mapping (SWARLY ↔ Supabase)
| Field in SWARLY | Where in Supabase |
|---|---|
| Project URL | Project Overview → Project URL (https://<ref>.supabase.co); often duplicated under Project Settings → API Keys |
| Anon Key | Project Settings → API Keys → public / publishable key labeled anon or public (long JWT,eyJ…) |
| Service Role Key | Project Settings → API Keys → service_role (secret server key — Reveal, then copy) |
| Database Password | Project Settings → Database → Database password (or reset via Reset database password); may also appear inside a connection string as [YOUR-PASSWORD] |
| Postgres pooler host | Connect (project toolbar) → choose Session pooler / connection pooling → copy host only (e.g. aws-0-….pooler.supabase.com) |
1. Project URL
- Open your project in the Supabase dashboard.
- On Project Overview, find Project URL (or open Project Settings → API Keys — the same URL is often shown there).
- It should look like https://abcdefghij.supabase.co — the middle part is your project reference.
- Copy the full URL including https:// and paste into SWARLY.
Important: Do not paste https://db.<ref>.supabase.co as the Project URL. That hostname is for direct Postgres, not the Supabase API. Using it here often causes pooler errors such as Tenant or user not found.
2. Anon (public) key
- Open Project Settings → API Keys.
- Find the public / publishable / anon key section (Supabase may rename the heading).
- Copy the key named anon or public. It is a long JWT and usually starts with eyJ.
- Paste the entire token. Do not add Bearer or quotes.
3. Service role key
This key bypasses Row Level Security. Treat it like a root password: never commit it, never put it in frontend code, and avoid sharing screenshots that show it.
- Stay on Project Settings → API Keys.
- Find service_role under the secret / server keys area. Supabase hides it by default — click Reveal (you may need to confirm).
- Copy the full JWT into SWARLY's Service Role Key field.
4. Database password
This is the password for the default postgres database role — not your Supabase account password.
- Go to Project Settings → Database.
- Look for Database password, or a connection string that contains [YOUR-PASSWORD] — replace that placeholder mentally with the password you set.
- If you never saved it or forgot it: use Reset database password in that area, copy the new password immediately, and paste it into SWARLY.
5. Postgres pooler host
The direct host db.<ref>.supabase.co can be IPv6-only. Some deployment regions (e.g. parts of Vercel) cannot reach it. The session pooler provides an IPv4-friendly hostname for the same database.
- In your Supabase project, click Connect in the project toolbar (or open connection instructions from Database, depending on your layout).
- Select Session pooler (or Connection pooling with Session mode — not Transaction mode for this field).
- Copy only the hostname, e.g. aws-1-eu-central-1.pooler.supabase.com. No https://, no path, no port in the SWARLY field (Postgres uses 5432).
- The connection UI may show a username like postgres.<ref> — SWARLY derives that from your Project URL; you only paste the pooler host here.
Alternative: enable Supabase's IPv4 add-on for the project and leave the pooler host empty if direct db.* works from your environment.
6. In SWARLY: save and verify
- Click Save on the connection form.
- Click Test connection — you want all checks to pass (or clear failures) before relying on the integration.
Troubleshooting (most common)
- Error about URL / tenant not found: you likely used db.<ref>. Replace with https://<ref>.supabase.co.
- Anon key check fails: verify URL and anon key belong to the same project and re-copy without quotes/Bearer prefix.
- Service role check fails: reveal and copy service_role again from API Keys for the same project.
- Postgres host unreachable: set Session pooler host from Connect -> Session pooler, or enable IPv4 add-on.