Skip to content

Installation

  • A PostgreSQL database (version 14 or later)
  • psql or 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

Clone the SMTA repository and generate a combined SQL script for your chosen adapter:

Terminal window
# For Supabase
npm run build:supabase
# → output/SMTA-supabase-<timestamp>.sql (59 SQL files combined)
# For Payload CMS
npm 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 the generated script to your PostgreSQL database:

Terminal window
psql -h YOUR_HOST -U YOUR_USER -d YOUR_DATABASE -f output/SMTA-supabase-<timestamp>.sql

For Supabase, you can paste the contents directly into the Supabase SQL Editor.

SMTA creates the following schemas in your database:

  • core — identity, access, memberships, roles, audit
  • platform — SaaS-wide management, billing, overrides (service role only)
  • utils — shared utility functions
  • public — 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.

Follow the Quick Start guide for your adapter: