The modern micro-SaaS trinity: Supabase, Stripe, and SadaSend
In 2026, solo founders and small engineering teams can ship full-scale SaaS applications without managing dedicated backend infrastructure. The winning trifecta has consolidated around three specialized engines: Supabase for Postgres data and authentication, Stripe for global payment processing, and SadaSend for transactional email delivery.
Each engine operates independently through webhooks and scoped credentials. However, wiring them together often causes subtle production bottlenecks: Supabase Auth defaults to a restrictive 2 emails/hour rate limit, and Stripe webhook handlers frequently suffer connection timeouts if synchronous email calls block worker execution.
By routing Supabase Auth through SadaSend custom SMTP and dispatching Stripe invoice receipts via asynchronous edge HTTP requests, you achieve low-latency execution with zero dropped customer notifications.
Architecture Breakdown: Authentication, Billing & Notification Flow
| Pipeline Event | Trigger Source | Execution Layer | SadaSend Integration |
|---|---|---|---|
| User Signup & Magic Link | Supabase Auth UI | Postgres GoTrue Engine | Custom SMTP Relay (smtp.sadasend.com:587) |
| Checkout & Subscription | Stripe Checkout | Next.js 15 Server Action | REST API (POST /emails) with Idempotency-Key |
| Invoice & Failed Payment | Stripe Webhooks | Deno Edge Function | REST API with Dead-Letter Queue (DLQ) Fallback |
| Staging & Preview Tests | Vercel Preview PR | Vitest E2E Harness | Hardware Recipient Allowlist (*@company.com) |
Production Stripe Webhook Dispatcher (TypeScript & Next.js)
Here is a battle-tested Next.js Route Handler verifying Stripe webhook signatures and triggering instant transactional receipts via SadaSend.
import { headers } from 'next/headers';
import { NextResponse } from 'next/server';
import Stripe from 'stripe';
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!, { typescript: true });
export async function POST(req: Request) {
const body = await req.text();
const signature = (await headers()).get('stripe-signature');
if (!signature) {
return NextResponse.json({ error: 'Missing stripe signature' }, { status: 400 });
}
let event: Stripe.Event;
try {
event = stripe.webhooks.constructEvent(body, signature, process.env.STRIPE_WEBHOOK_SECRET!);
} catch (err: unknown) {
const msg = err instanceof Error ? err.message : String(err);
return NextResponse.json({ error: `Webhook signature verification failed: ${msg}` }, { status: 400 });
}
if (event.type === 'invoice.payment_succeeded') {
const invoice = event.data.object as Stripe.Invoice;
const customerEmail = invoice.customer_email;
if (customerEmail) {
await fetch('https://api.sadasend.com/emails', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.SADASEND_API_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': `stripe-invoice-${invoice.id}`,
},
body: JSON.stringify({
from: 'billing@mail.yourdomain.com',
to: customerEmail,
subject: `Invoice Paid: #${invoice.number ?? invoice.id}`,
html: `<h2>Payment Confirmed</h2><p>Your subscription payment of $${(invoice.amount_paid / 100).toFixed(2)} was successful.</p>`,
tags: ['billing', 'stripe', 'invoice'],
source: 'api',
agent_name: 'StripeWebhookProcessor',
}),
});
}
}
return NextResponse.json({ received: true });
}Beyond Stripe: Modern Merchant of Record Alternatives (Polar.sh & Paddle)
While Stripe remains the standard for custom billing pipelines, many indie hackers and micro-SaaS founders prefer Merchant of Record (MoR) providers like Polar.sh and Paddle. A Merchant of Record handles global sales tax, EU VAT collection, currency conversion, and localized checkout out-of-the-box, drastically reducing administrative overhead.
SadaSend integrates cleanly with both Polar.sh and Paddle webhooks. When a customer subscribes or purchases a license key, the MoR webhook fires into your backend, and SadaSend dispatches the branded receipt, access link, and dual-DKIM signed confirmation within milliseconds with zero dropped webhooks.
// app/api/webhooks/polar/route.ts
import { NextResponse } from 'next/server';
import { Webhook } from 'standardwebhooks';
const webhook = new Webhook(process.env.POLAR_WEBHOOK_SECRET!);
export async function POST(req: Request) {
const payload = await req.text();
const headers = Object.fromEntries(req.headers.entries());
try {
webhook.verify(payload, headers);
} catch (err) {
return NextResponse.json({ error: 'Invalid Polar signature' }, { status: 400 });
}
const event = JSON.parse(payload);
if (event.type === 'order.created') {
const order = event.data;
// Dispatch branded transactional receipt via SadaSend
await fetch('https://api.sadasend.com/emails', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.SADASEND_API_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': `polar-order-${order.id}`,
},
body: JSON.stringify({
from: 'billing@yourdomain.com',
to: order.customer.email,
subject: `Receipt for Order #${order.id}`,
html: `<h2>Thank you for your purchase!</h2><p>Amount: $${(order.amount / 100).toFixed(2)}</p>`,
tags: ['billing', 'polar', 'receipt'],
}),
});
}
return NextResponse.json({ status: 'ok' });
}Supabase Auth SMTP Configuration in 60 Seconds
To uncap your authentication magic links and password reset OTPs:
- Log in to your Supabase Project Dashboard and open Project Settings -> Authentication.
- Scroll to SMTP Settings and enable the Custom SMTP toggle.
- Set Sender Email to your verified domain (e.g. auth@mail.yourdomain.com) and Sender Name to your product.
- Set Host to smtp.sadasend.com and Port to 587.
- Set Username to apikey and Password to your SadaSend API Key (e.g. sada_live_...), then click Save.
Preventing Database Seeds from Leaking in Preview Environments
When testing locally or in Vercel preview branch deployments, never use your live production SadaSend API key.
Provision a dedicated Staging API key in the SadaSend dashboard configured with a Recipient Allowlist (e.g. *@yourcompany.com). Even if your local Postgres seed populates 1,000 dummy customer profiles, any accidental dispatches will be stopped at the gateway.
Send transactional emails in under 3 minutes
EU-hosted delivery, custom SMTP relay, 100% SPF/DKIM alignment, and automated suppression firewalls. 6,000 free sends every month without a credit card.
Building SadaSend — transactional email with an MCP server that has a ceiling. Writes about deliverability, email infrastructure, and what happens when you hand an autonomous agent a sending credential.