Skip to Content
IntegrationsSupabase

Supabase

The Supabase integration connects your project to TinyOps, enabling rules that monitor database table row counts and authentication user growth. This is a data-source integration. It provides checks for building conditions but does not perform write actions in v1.

Setup

Locate Your Project Credentials

Open the Supabase dashboard and navigate to Project Settings, then API. You will need two values:

  • Project URL (e.g. https://xyzcompany.supabase.co)
  • Service Role Key (the service_role secret, not the anon key)

Add the Integration in TinyOps

Open TinyOps and go to Settings then Integrations. Click Add Integration and select Supabase.

Enter Your Credentials

Paste both the Project URL and the Service Role Key into the form fields. TinyOps will verify connectivity by querying your project metadata.

Verify Connection

Confirm the integration status shows Connected. Your Supabase project name and region will be displayed.

The Service Role Key has full access to your database and bypasses Row Level Security. TinyOps uses it solely for read-only count queries. Never expose this key in client-side code.

Available Checks

NameReturn TypeDescription
table.{name}.countnumberRow count for the specified table. Replace {name} with your table name (e.g. table.orders.count).
auth.users_countnumberTotal number of registered users in Supabase Auth

Coming soon: db.size (database size in MB) and storage.usage (storage bucket usage in MB) are planned for a future release once the Supabase Management API support is finalized.

Available Actions

No actions are available for the Supabase integration in v1. It operates as a read-only data source for building rule conditions.

Example Rules

Database Row Count Monitor

Alert when a table grows beyond an expected threshold, which may indicate runaway inserts or a data import issue.

db-row-monitor.yaml
name: Database Row Count Monitor trigger: schedule: "0 */6 * * *" provider: supabase conditions: - check: table.events.count operator: gt value: 1000000 actions: - method: notify provider: slack params: channel: "#backend" message: "The events table has {{table.events.count}} rows, exceeding the 1M threshold. Investigate potential runaway writes."

User Growth Tracking

Send a weekly summary of total registered users to the team.

user-growth-weekly.yaml
name: Weekly User Growth Report trigger: schedule: "0 9 * * 1" provider: supabase conditions: - check: auth.users_count operator: gt value: 0 actions: - method: notify provider: email params: to: "team@tinyops.cc" subject: "Weekly User Count: {{auth.users_count}} registered users" body: "As of this week, your Supabase project has {{auth.users_count}} total registered users."

Troubleshooting

Common issues:

  • Connection refused: Double-check that you are using the full Project URL including the https:// prefix. The URL should end with .supabase.co.
  • Permission denied on table count: Ensure you are using the Service Role Key, not the anon key. The anon key is subject to Row Level Security and may return zero counts.
  • Table not found: The table name in table.{name}.count must match exactly. Table names are case-sensitive and should not include the schema prefix.
  • Stale counts: Row counts are fetched live from the database. If your table uses soft deletes, the count reflects all rows including soft-deleted ones.