Connect Supabase to Superblocks in four steps
To connect Supabase to Superblocks, you create a resource in Superblocks that points to your Supabase project, then authenticate using your Supabase API key and URL. Superblocks treats Supabase as a PostgreSQL database connection, so the setup uses standard database credentials rather than a special Supabase plugin. Once connected, you can query your Supabase tables directly from Superblocks workflows and applications.
The process takes about five minutes and requires your Supabase project URL and an API key with the right permissions. After that, any Superblocks workflow or app in your workspace can read from or write to that Supabase database without re-entering credentials.
Key Takeaways
- Superblocks connects to Supabase through a PostgreSQL resource, using your Supabase project URL and an API key.
- You generate the API key in Supabase's settings under the API section, and you can restrict it to specific tables or operations.
- After creating the resource in Superblocks, you test the connection before using it in workflows or applications.
- Once connected, any Superblocks user in your workspace can query Supabase tables without managing separate credentials.
Find your Supabase project URL and API key
Open your Supabase project and navigate to the Settings menu in the left sidebar. Select API to view your project credentials. You will see your Project URL (the base address of your Supabase instance) and several API keys. For most use cases, use the anon key, which has public read and write permissions. If you need to restrict access to specific tables or operations, you can create a custom role and generate a key with narrower permissions.
Copy both the Project URL and the API key you plan to use. Keep the API key private — treat it like a password. If you accidentally expose it, you can regenerate it in the same API settings page, and the old key will stop working immediately.
Create a PostgreSQL resource in Superblocks
Log into Superblocks and open the workspace where you want to use Supabase. Click Resources in the left navigation, then click Create New. Select PostgreSQL from the database options. Superblocks will open a form asking for connection details.
Fill in the form with these values: for Host, enter your Supabase Project URL (the full URL, not just the domain). For Port, use 5432 (Supabase's default PostgreSQL port). For Database, enter postgres. For Username, enter postgres. For Password, paste your Supabase API key. Leave SSL Mode set to Require unless Supabase instructs otherwise. Give the resource a name like "Supabase Production" so you can identify it later.
Test the connection before using it
After filling in the connection details, Superblocks offers a Test Connection button. Click it to verify that Superblocks can reach your Supabase database. If the test succeeds, you will see a green confirmation. If it fails, Superblocks will show an error message — usually a permissions issue with the API key, a typo in the URL, or a network restriction on your Supabase project.
Common failures include using the wrong API key (make sure you copied the full key with no extra spaces), entering the Project URL without the protocol (it should start with https://), or having a firewall rule that blocks Superblocks' IP addresses. If you are unsure, check your Supabase project's Network settings to see if IP restrictions are active.
Use the Supabase resource in workflows and applications
Once the connection is tested and saved, the resource appears in the Resources dropdown whenever you build a query or action in Superblocks. When you create a new SQL query, select your Supabase resource from the dropdown, then write standard PostgreSQL syntax to read or write data. Superblocks will execute the query against your Supabase database and return the results.
You can use the same resource across multiple workflows and applications in your workspace. If you need to rotate the API key for security reasons, update it in the resource settings, and all queries using that resource will automatically use the new key.
Manage permissions and security
By default, the anon key in Supabase allows public read and write access to tables that have public policies enabled. If you want tighter control, create a new API key with a custom role in Supabase that only has permission to specific tables or operations. You can also use Supabase's Row Level Security (RLS) to restrict data at the row level — for example, so users only see their own records.
Store your API key securely and rotate it periodically. If you suspect the key has been exposed, regenerate it immediately in Supabase's API settings. Superblocks will continue to work as long as you update the resource with the new key before the old one expires.
Troubleshoot common connection issues
If Superblocks cannot connect to Supabase, check these points in order. First, verify that you copied the Project URL correctly — it should be the full HTTPS URL shown in Supabase's API settings, not a shortened version. Second, confirm that the API key is complete and has no trailing spaces. Third, check that your Supabase project is not paused — Supabase pauses free-tier projects after a week of inactivity, and you must resume them manually.
If the connection test passes but queries fail, the issue is usually permissions. Check that your API key's role has access to the tables you are querying. If you are using RLS, make sure the policy allows the key's role to read or write the data. You can test your key directly in Supabase's SQL Editor to confirm it works before troubleshooting further in Superblocks.
Frequently Asked Questions
Can I use a service role key instead of an anon key?
Yes. The service role key has admin permissions and bypasses RLS policies, so it is useful for backend operations that need full access. However, treat it as a secret — never expose it in client-side code. Use it only in Superblocks workflows that run server-side, not in public applications.
What happens if I regenerate my API key in Supabase?
The old key stops working immediately, and any Superblocks queries using it will fail. You must update the resource in Superblocks with the new key. Superblocks will not automatically detect the change, so update it as soon as you regenerate the key to avoid downtime.
Can I connect multiple Supabase projects to the same Superblocks workspace?
Yes. Create a separate PostgreSQL resource for each Supabase project, giving each one a descriptive name. When you build a query, select the resource that points to the project you want to query. This is useful if you have separate Supabase instances for development, staging, and production.
Do I need to set up anything special in Supabase before connecting?
No. Supabase is ready to connect as soon as your project is created. You only need your Project URL and an API key, both of which are available in the API settings. If you want to use RLS or custom roles, set those up in Supabase first, then use the corresponding key in Superblocks.