Setu Recipes: reusable digital workers across every app.Browse templates

Integrations / Supabase

Supabase

Supabase Management API: projects, organizations, SQL queries on a project's database, and read-only Edge Function and secret listings.

6 actions OAuth 2 5 read1 write Calls api.supabase.com

Connect

TypeScript
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "supabase" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();

Permissions requested

ScopeWhy it is requested
projects:readSee your Supabase projects
organizations:readSee your Supabase organizations
database:writeRun SQL queries on project databases
edge_functions:readSee the Edge Functions of a project
secrets:readSee the names of a project's secrets

Actions

Get projectreadsupabase.get_projectGet one Supabase project by its ref: name, region, status, organization and database host.

Needs scope: projects:read

InputTypeDescription
refstringRequiredProject ref (the 20-character project identifier)
TypeScript
await setu.execute({
  userId: "user_1",
  action: "supabase.get_project",
  input: {
    "ref": "<ref>"
  },
});
List Edge Functionsreadsupabase.list_functionsList the Edge Functions deployed on a project with slug, status and version.

Needs scope: edge_functions:read

InputTypeDescription
refstringRequiredProject ref
TypeScript
await setu.execute({
  userId: "user_1",
  action: "supabase.list_functions",
  input: {
    "ref": "<ref>"
  },
});
List organizationsreadsupabase.list_organizationsList the Supabase organizations the connected account belongs to.

Needs scope: organizations:read

No input.

TypeScript
await setu.execute({
  userId: "user_1",
  action: "supabase.list_organizations",
  input: {},
});
List projectsreadsupabase.list_projectsList all Supabase projects the connected account can access, with ref, name, region and status.

Needs scope: projects:read

No input.

TypeScript
await setu.execute({
  userId: "user_1",
  action: "supabase.list_projects",
  input: {},
});
List secret namesreadsupabase.list_secret_namesList the names of a project's Edge Function secrets. Only names are returned, never values.

Needs scope: secrets:read

InputTypeDescription
refstringRequiredProject ref
TypeScript
await setu.execute({
  userId: "user_1",
  action: "supabase.list_secret_names",
  input: {
    "ref": "<ref>"
  },
});
Run SQL querywritesupabase.run_sqlRun a SQL query on a project's Postgres database through the Management API. Can change data unless read_only is true. The endpoint is documented as experimental.

Needs scope: database:write

InputTypeDescription
refstringRequiredProject ref
querystringRequiredSQL to run
parametersarray of anyOptionalPositional parameters for $1, $2... placeholders
read_onlybooleanOptionalRun the query in a read-only transaction
TypeScript
await setu.execute({
  userId: "user_1",
  action: "supabase.run_sql",
  input: {
    "ref": "<ref>",
    "query": "<query>"
  },
});