Bubble
+
Supabase

Bubble + Supabase Security

Bubble's visual development combined with Supabase's PostgreSQL backend is powerful, but requires careful API security configuration.

Why Bubble + Supabase?

Bubble developers often need more database flexibility than Bubble's built-in database offers. Supabase provides SQL capabilities with a REST API that Bubble can consume.

Common Vulnerabilities

These are the security issues we find most often in Bubble apps using Supabase.

critical

API Key Exposure in Bubble

Supabase keys stored in Bubble's API connector may be exposed to client-side JavaScript.

critical

Missing RLS on Connected Tables

Tables queried via Bubble's API connector need RLS, but it's often not configured.

high

Overly Permissive API Calls

Bubble workflows may fetch more data than the user should access, relying on frontend filtering.

critical

Service Key in API Connector

Using service_role key in Bubble's API connector bypasses all RLS protections.

What We Check for Bubble + Supabase

API Key Type Verification

Verify only anon key is used in Bubble, never service_role key.

RLS Configuration

Test all Supabase tables connected to Bubble for proper RLS.

API Call Scope

Review Bubble workflows for appropriate data filtering at the database level.

Authentication Flow

Check that Supabase Auth is properly integrated with Bubble user sessions.

Quick Security Wins

Apply these fixes right now to improve your security.

Use only the anon key in Bubble API connector - never service_role
Enable RLS on ALL tables: ALTER TABLE t ENABLE ROW LEVEL SECURITY
Write RLS policies that filter by user: USING (auth.uid() = user_id)
Use Supabase Auth for user management, sync with Bubble users
Add .select() filters in API calls to limit returned columns

The Bottom Line

Bubble + Supabase works well when using anon key with proper RLS. Never use service_role key in Bubble - it bypasses all security.

Secure Your Bubble + Supabase App

Find Row Level Security misconfigurations, exposed credentials, and other vulnerabilities before attackers do.

Start Security Scan

Frequently Asked Questions

Should I use anon or service_role key in Bubble's API connector?

Always use the anon key. The service_role key bypasses all RLS and gives full database access - if exposed (and API connector keys can be exposed), attackers get complete control. The anon key respects RLS policies, providing proper access control.

How do I pass user authentication from Bubble to Supabase?

Option 1: Use Supabase Auth directly and pass the JWT to API calls. Option 2: Create a backend workflow that authenticates with Supabase using Bubble's logged-in user info. The JWT approach is more secure as it validates user identity at the database level.

Can I use Bubble's database alongside Supabase?

Yes, but consider the security implications. Keep sensitive data in Supabase with RLS protection. Use Bubble's database for app-specific data. Be careful about data synchronization - ensure user IDs match between systems if you need to correlate data.

Why do I need RLS if Bubble controls what data is displayed?

Bubble controls the UI, but API calls can be intercepted and modified. Without RLS, anyone who captures your API call can modify it to access any data. RLS enforces access control at the database level - even if someone crafts a malicious API call, they can only access authorized data.