Supabase
Data from an external Supabase project (tables through the Data API) when the app should use an existing database.
Connection type: For the app and the agent. Credentials: Supabase project URL, Secret key (sb_secret_…).
How it works
The app and the agent never see the credentials. They call the Supabase API through the Bloklo gateway, for example fetch("/gw/<connection id>/rest/v1/"). The gateway appends the path to the address given in the connection, adds a apikey header with the key from the connection, and passes the service's response back to the app.
- Reads (GET) go through at once. Writes (POST, PUT, PATCH, DELETE) go through at once only when the connection is set to Always allow; otherwise the gateway returns status 202 with an
approval_idand the write waits for approval in the panel (see Agent permissions). - The Test button sends
GET /rest/v1/and checks that the service accepted the credentials.
Data API (PostgREST) under /rest/v1: tables and views as resources, filters in query parameters (column=eq.value), JSON bodies. Access is enforced by roles and RLS policies; the secret key bypasses RLS. Prefer: return=representation returns changed rows, resolution=merge-duplicates gives upsert.
Before you start
- An account with Supabase with permission to create API keys or tokens.
Where to get the credentials
- In Supabase, open the project → Project Settings → API Keys and, under Secret keys, create or copy an
sb_secret_…key. - In Project Settings → Data API, copy the Project URL.
The secret key bypasses row level security (RLS) and has full data access; Bloklo keeps it on the server only.
Connecting in Bloklo
- Open Connectors in the sidebar and find Supabase.
- Click Connect and enter a connection name in Details.
- In Configure connection, fill in: Supabase project URL, Secret key (sb_secret_…).
- Click Connect. Bloklo saves the credentials encrypted and sends a test request; the message shows whether the service responded.
- Attach the connection to a project: Attach to a project… on the connection page, or describe the task in the project chat and pick the connection the agent suggests.
Form fields
- Supabase project URL: Project Settings → Data API → Project URL (without /rest/v1).
- Secret key (sb_secret_…): Project Settings → API Keys → Secret keys. It bypasses RLS; kept only on the Bloklo server.
Never paste credentials into the chat with the agent. Enter them only in the connection form.
Example prompts
Prompts to type in the chat of a project with the connection attached:
- “Add an orders table in Supabase and a form that saves new orders.”
- “Build a product list with filtering and sorting from the products table.”
- “Add a panel with record counts from a SQL function.”
API methods
The most commonly used Supabase API methods. The path goes after /gw/<connection id>; parts in braces, such as {id}, are replaced with values. The gateway treats every request other than GET as a write, including queries sent with POST (such as search or GraphQL), so they need approval unless the connection is set to Always allow. The full list of methods is in the provider's documentation.
| Method | Path | What it does | In the gateway |
|---|---|---|---|
GET | /rest/v1/{table} | Read rows with filters and ordering | read |
POST | /rest/v1/{table} | Insert one or many rows | write (approval) |
POST | /rest/v1/{table}?on_conflict={column} | Insert or update (upsert) | write (approval) |
PATCH | /rest/v1/{table}?id=eq.{id} | Update rows matching a filter | write (approval) |
DELETE | /rest/v1/{table}?id=eq.{id} | Delete rows matching a filter | write (approval) |
POST | /rest/v1/rpc/{function} | Call a SQL function | write (approval) |
HEAD | /rest/v1/{table} | Check table availability | read |
Service limits
No fixed Data API request limit is published; limits are configured per project. Returned rows are capped by the project's max rows setting plus limit/offset or the Range header. The docs example limits writes to 100 per 5 minutes per IP (a custom function).
Agent actions and permissions
| Action | Type | What the agent uses it for |
|---|---|---|
| Read data | read | Fetches data from the service, such as a list of records, to build and check the app. Examples: read rows with filters and ordering; check table availability. |
| Write data | write | Requests other than GET: creating, changing or deleting data in the service, and also queries sent with POST (such as search). Examples: insert one or many rows; insert or update (upsert); update rows matching a filter. |
By default, reads run without asking and writes need approval in the chat. Change this on the connector page or in Settings → Agent permissions (see Agent permissions).
Troubleshooting
The connection test shows “Invalid key” (HTTP 401)
The service did not recognise the credentials: the value is wrong, expired, revoked or was copied with a space. Create a new key at the provider and enter it on the connection page under Change credentials. Empty fields stay unchanged.
The connection test shows “Invalid key” (HTTP 403)
The credentials are rejected or lack the needed permissions, or the service only accepts requests from selected IP addresses. Check the key, extend its permissions at the provider or add the Bloklo gateway IP address (shown in Settings → Privacy & security) to the allowlist.
The test returns another HTTP code
The Test button sends the service a read request that requires valid credentials. A code other than 401 and 403 usually means a temporary problem at the service or a restriction on the account at the provider; include the error code shown with the result in a problem report.
Limits and security
- One connection can make up to 1,000 requests per minute; the service's own limits also apply.
- Credentials are encrypted and not shown in the browser after saving; only the names of stored fields are visible.
- A published app works for every visitor: protect the data the connection gives access to with sign-in in the app.
Something unclear or out of date? Contact us