Supabase adapter
The Supabase adapter uses the @supabase/supabase-js client and talks to your project over PostgREST. This is the recommended path if you use Supabase — it respects your Row Level Security policies.
Alternatively you can use the Postgres adapter pointed at Supabase’s direct Postgres connection string. Pick based on preference:
| Path | Notes |
|---|---|
| Supabase adapter (this page) | Uses PostgREST. RLS applies. Uses anon or service key. |
| Postgres adapter | Uses raw Postgres. RLS does not apply. Uses a DB user. |
Config shape
{ "type": "supabase", "config": { "url": "https://abcdefghi.supabase.co", "key": "${SUPABASE_ANON_KEY}" }, "collections": { "menu_items": { "source": "menu_items", "searchable_fields": ["name", "description"], "filterable_fields": ["category", "price", "vegan"], "display_fields": ["id", "name", "price", "category"] } }}Setup
-
Pick an API key
Supabase has two keys:
anon— respects RLS. Recommended. Make sure you have a read-only RLS policy for the tables Spelo needs.service_role— bypasses RLS. Only use if you understand the implications.
Find them in Project Settings → API.
-
Write an RLS policy (if using the anon key)
Example — public read on
menu_items:ALTER TABLE menu_items ENABLE ROW LEVEL SECURITY;CREATE POLICY "Public read menu" ON menu_itemsFOR SELECTUSING (true);For per-tenant data, scope by a claim in the JWT. Spelo’s anon key request can be further filtered by your RLS.
-
Paste URL + key in the dashboard
Dashboard → Data → Supabase → paste → Test connection.
-
Map collections — the
sourceis the table name (case-sensitive, schema-qualified asschema.tableif needed).
Operator translation
| SearchParams operator | PostgREST chain |
|---|---|
eq | .eq(field, value) |
neq | .neq(field, value) |
gt / gte / lt / lte | .gt/.gte/.lt/.lte(field, value) |
contains (array column) | .contains(field, [value]) |
contains (text column) | .ilike(field, '%value%') |
in | .in(field, values) |
free-text query | .or('a.ilike.%q%,b.ilike.%q%,...') over searchable_fields |
Security notes
- Values in the
.or()expression are escaped so commas and parentheses can’t break out of the PostgREST expression. - The adapter never uses
.upsert,.update,.delete, or.rpc. Read-only by construction.
Supabase Edge Functions
If you host bespoke query logic in a Supabase Edge Function, point the REST adapter or Webhook adapter at the function URL instead.
Troubleshooting
JWSError→ invalid key. Copy-paste again from Project Settings → API.- Empty results with no error → your RLS policy is denying the read. Log in to the Supabase SQL editor as
anonand runSELECT * FROM your_table— if it’s empty, the policy is the issue. PGRST116(too many rows) → you asked for more rows than PostgREST’s limit. Spelo capsmax_limitat 10 so this shouldn’t happen, but check for misconfig.
More: Database connection errors.