Installation
Prerequisites
Section titled “Prerequisites”- A PostgreSQL database (version 14 or later)
psqlor another SQL client to apply the script- Node.js 18+ and pnpm installed (to generate the deployment script)
- A Supabase project or a Payload CMS project with a PostgreSQL connection
Generate the Deployment Script
Section titled “Generate the Deployment Script”Clone the SMTA repository and generate a combined SQL script for your chosen adapter:
# For Supabasenpm run build:supabase# → output/SMTA-supabase-<timestamp>.sql (59 SQL files combined)
# For Payload CMSnpm run build:payload# → output/SMTA-payload-<timestamp>.sql (57 SQL files combined)Both scripts deploy the full SMTA feature set. The only difference is the auth implementation and, for Supabase, the restoration of auth.users foreign keys.
Apply to Your Database
Section titled “Apply to Your Database”Apply the generated script to your PostgreSQL database:
psql -h YOUR_HOST -U YOUR_USER -d YOUR_DATABASE -f output/SMTA-supabase-<timestamp>.sqlFor Supabase, you can paste the contents directly into the Supabase SQL Editor.
After Deployment
Section titled “After Deployment”SMTA creates the following schemas in your database:
core— identity, access, memberships, roles, auditplatform— SaaS-wide management, billing, overrides (service role only)utils— shared utility functionspublic— callable SQL functions (RPC interface)
Your application tables go in the app schema. SMTA creates this schema but does not define any tables in it — you define those to match your domain.
Next Steps
Section titled “Next Steps”Follow the Quick Start guide for your adapter: