RLS is tied to the platform
On Supabase, policies call auth.uid(), auth.jwt() and auth.role(), which only exist in Supabase.
Early development
Unvendor is an open source toolkit for converting a Backend-as-a-Service deployment into standard, self-hostable components: plain PostgreSQL, any OIDC identity provider and S3-compatible storage. The goal is to do this without a full rewrite of the app.
Backend-as-a-Service platforms (Supabase, Firebase, Appwrite, Nhost, PocketBase) bundle database, auth, storage and functions behind platform-specific APIs. Apps built on them become hard to self-host, migrate or audit, even when parts of the platform are open source.
On Supabase, policies call auth.uid(), auth.jwt() and auth.role(), which only exist in Supabase.
Application tables reference IDs in auth.users, so accounts can't simply be recreated somewhere else.
The object store knows nothing about them, so copying files isn't enough.
Today, leaving means a dump, one-off scripts and rewriting access control by hand. Self-hosting the platform itself changes where it runs, not what the app depends on.
Each part of the platform moves onto a standard replacement that can be swapped independently. Supabase is the first source platform and the reference implementation; others are planned through a source adapter interface.
Reads schemas, roles, RLS policies that use auth.*, buckets, functions and secrets, and reports everything that has to move. Platform-specific reading sits behind an adapter interface so other platforms can be added later.
Exports users, identities, password hashes and MFA factors. Imports into Keycloak through its native user import, keeping user IDs and bcrypt hashes through a small Keycloak bcrypt provider, so users don't have to reset their passwords. A SCIM 2.0 export covers other OIDC providers such as Authentik and Zitadel.
Rewrites policies that call auth.uid(), auth.jwt() and auth.role() into portable SQL on top of a small shim schema. Anything that can't be converted is listed in the report. Every rewrite gets a negative test, and differential tests compare what each user can see on source and target.
Copies buckets and objects to any S3-compatible backend (SeaweedFS, Ceph Object Gateway), maps public buckets to anonymous read, keeps all other buckets private, and reports per-object rules with their original SQL.
An end-to-end harness runs the whole migration on a copy and compares row counts, logins and access. Documentation, reproducible packaging on npm, and fixes from a security review.
What exists today is a Supabase test fixture: tables with RLS policies, storage buckets with per-user folder policies, and a seed script. It is the source project used to develop and test the components.
Something has to set the claims that the translated policies read. The app's server side, or PostgREST, validates the OIDC token and sets them as a transaction-local setting before each query; the shim's auth.uid(), auth.jwt() and auth.role() read from that setting. Apps that reach the database only through supabase-js need a server-side layer first; the inventory flags this.
Unvendor is written in TypeScript and licensed under Apache-2.0. It is meant for teams that need to run their backend on infrastructure they control: small teams, NGOs, public bodies, and anyone who needs data sovereignty, GDPR-compliant self-hosting, or protection against pricing or platform changes.
If you've moved off a Backend-as-a-Service platform, or tried and gave up,open an issue and describe what broke.