Back
How Supabase RLS makes secure embedded dashboards deployable in one day
Jan 31, 2025
Serguei Balanovich
Co-Founder & CTO, Upsolve AI
TL;DR: If your app uses Supabase Auth with RLS, you can leverage that setup to embed dashboards securely with minimal effort using Upsolve AI.
Exposing user-specific data in a dashboard is straightforward in theory but notoriously difficult in practice. The challenge isn’t just building the UI or running queries—it’s making sure every user sees only their own data.
The real insight here? If you’ve already configured Row-Level Security (RLS) in your database, you’ve built the foundation for secure multi-tenancy. Dashboards don’t need their own bespoke access controls—they can reuse what you’ve already built.
Why RLS matters
Security at the database layer is one of the most robust ways to enforce access controls. Unlike middleware filters or application-level checks, RLS policies are enforced directly by the database, ensuring that every query respects the security rules, regardless of how or where it’s executed.
For example, with Supabase:
Policies can be scoped to users, roles, or even specific data attributes.
Queries are implicitly filtered at the source, eliminating the risk of accidental data exposure at the application layer.
Once RLS is configured, the database becomes the source of truth for data security. This is critical when exposing sensitive data, like in customer-facing dashboards, where the consequences of misconfiguration can be severe.
The Insight: Dashboards as an extension of RLS
If you’re using Supabase Auth and have RLS in place, embedding a secure dashboard doesn’t require extra effort to rebuild access controls. You can simply extend your existing policies to your dashboard.
Here’s how it works with Upsolve AI:
Use
supabase.auth.getSession()
to retrieve the session token from Supabase.Pass the token to the
<UpsolveDashboard />
React component as adbAuthToken={}
prop.
That’s it. Your dashboard queries the database directly and respects the same RLS policies already in place for your app. There’s no duplication of logic, and the database continues to handle access control.
Why this is cool
This approach combines simplicity with security. By reusing RLS, you avoid the overhead of building a separate security layer for dashboards. And because RLS is enforced at the database level, you don’t have to worry about middleware bugs or client-side missteps exposing the wrong data.
We’ve seen this enable teams to go from concept to production with embedded dashboards in under a day—not because they cut corners, but because they could rely on the database to enforce security.
If you’re working with Supabase Auth and RLS and want to experiment with this setup, we’re currently testing it with more teams. Feel free to share thoughts here or email us at team@upsolve.ai.