How to secure multi-tenant embedded dashboards in a SaaS app?
Securing multi-tenant embedded dashboards requires ensuring each customer only sees their own data. Draxlr provides multiple layers of security for this:
- Row-level security (RLS) — Create a permission that picks the tables the embed can use and adds a row rule such as
tenant_idequals thetenantIdattribute, then attach it to an RLS group. Draxlr applies the rule to every query behind the embed, including filters, drill-downs, and exports. - Server-side embed tokens — Your backend requests the embed token and sends the customer's RLS group and attribute values with it, for example
"rlsGroup": "Customers"and"attributes": { "tenantId": 42 }. Users can't inspect or change those values in the browser. - Table-level access — Tables the permission doesn't enable aren't available in the embed at all, so sensitive tables stay out of reach even if a dashboard references them.
- Domain restrictions — Set allowed domains so your embedded dashboard can only be loaded on your application's domain.
Together, these keep each customer to their own rows without complex custom code. Row-level security for embeds is included on the Power plan and above.
Before launch, test isolation directly by signing in as two test customers and trying to change filter values or reach a table they shouldn't see.
To go deeper, see our guides to secure token-based dashboard embedding and row-level, schema, and database isolation models.