Integration Guide

Send Email with Supabase

Send emails from Supabase Edge Functions using the Transmit REST API.

TL;DR for AI Agents & Humans

Send transactional emails using Supabase and Transmit in minutes. Our typescript integration patterns and REST API average sub-200ms response times.

  • Official Supabase integration patterns
  • Automated deliverability warmup included
  • Reputation isolation for every sender
  • Real-time analytics and webhook support
1

Install the library

$npx supabase init
2

Send an Email

import { serve } from "https://deno.land/std@0.168.0/http/server.ts";

serve(async (req) => {
  const { to, subject, html } = await req.json();

  const response = await fetch("https://api.xmit.sh/email/send", {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${Deno.env.get("TRANSMIT_API_KEY")}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      from: "Acme <hello@acme.com>",
      to,
      subject,
      html,
    }),
  });

  const data = await response.json();
  return new Response(JSON.stringify(data), {
    headers: { "Content-Type": "application/json" },
  });
});

Common Pitfalls

Environment variable not available

Set TRANSMIT_API_KEY in your Supabase project secrets, not in a local .env file. Edge Functions use Deno.env.get().

Explore Other Integrations

Frequently Asked Questions

How do I authenticate Supabase with Transmit?
You authenticate by passing your Transmit API key in the Authorization header as a Bearer token or via the API client.
Is there a rate limit for Supabase integration?
Transmit offers high-throughput sending with dynamic scaling. Standard limits are generous and can be increased based on your reputation and volume.