@smta/supabase
v0.4.0
Published
SMTA Supabase adapter — auth.uid(), Vault, PostgREST config, platform schema
Readme
@smta/supabase
The Supabase adapter for SMTA (SaaS Multi-Tenant Architecture). Wires SMTA's auth and secrets interfaces to Supabase's JWT claims (auth.uid()) and Vault, and adds auth.users foreign key constraints to the core tables.
What's in this package
3 SQL files that supplement @smta/core for Supabase deployments:
| File | Purpose |
|------|---------|
| auth_supabase_impl.sql | Implements core.get_current_user_id() using auth.uid() from the Supabase JWT |
| secrets_supabase_impl.sql | Implements core.store_secret_impl() and core.delete_secret_impl() using Supabase Vault |
| constraints.sql | Adds foreign keys from SMTA tables to auth.users |
Usage
This package is consumed by @smta/cli — you do not install it directly. To deploy SMTA with the Supabase adapter, run:
npx @smta/cli --adapter supabaseThe CLI combines @smta/core and @smta/supabase into a single deployment script. Paste the output into the Supabase SQL Editor or apply via psql.
See the Supabase Quick Start for the full walkthrough.
Part of the SMTA package family
| Package | Purpose |
|---------|---------|
| @smta/core | Adapter-agnostic SQL schema |
| @smta/supabase | This package — Supabase adapter SQL |
| @smta/payload | Payload CMS adapter SQL + middleware |
| @smta/billing | BillingProvider interface (Stripe, Lemon Squeezy) |
| @smta/schemas | Zod v4 schemas for all public.* RPC contracts |
| @smta/cli | Deployment CLI |
License
MIT
