Documentation
Self-hosting PayCraft
PayCraft is fully self-hostable. The backend is Supabase (Postgres + Auth + Edge Functions); point the SDK at your own instance and you own the entire billing stack.
Architecture
Client App → PayCraft SDK → your Supabase (source of truth)
Payment Provider (Stripe / Razorpay) → Webhook → your SupabaseThe app never talks to the payment provider directly — it only reads entitlement from Supabase, which provider webhooks keep in sync.
Point the SDK at your backend
PayCraft.initialize(
apiKey = "pk_live_YOUR_KEY_HERE",
backend = PayCraftBackend.SelfHosted(
supabaseUrl = "https://billing.yourcompany.com",
supabaseAnonKey = "eyJ…",
),
)Deploy the backend
- Docker Compose — a single compose file brings up Supabase + the Edge Functions and applies migrations.
- Helm chart — for Kubernetes deployments.
- Bring your own domain + TLS, and set your provider secrets as Edge Function secrets.
Full setup — compose file, Helm values, migrations, and webhook wiring — is in the reference docs.