One-time setup
These commands run on your local machine, not inside Lovable. You only do this once.
Set up AWS
If you already have AWS configured, skip this. AWS setup guide →
Deploy email infrastructure
npx @wraps.dev/cli email init
Sets up SES in your account and verifies your sending domain. This is where your emails actually send from — your AWS, your domain. Domain verification guide →
Connect to the Wraps Platform
npx @wraps.dev/cli platform connect
Creates a cross-account IAM role so the Wraps Platform can send email through your SES when a workflow fires. Run this once — re-run wraps platform update-role if you add new features later.
Get a Wraps API key
In the Wraps dashboard, go to Settings → API Keys and create a new key. Name it something like lovable-app.
Add the key to Lovable (Supabase)
Lovable apps run on Supabase. Go to your Supabase Dashboard → Edge Functions → Secrets and add:
WRAPS_API_KEY = wraps_a1b2c3d4....<hmac>
VITE_ gets bundled into browser JavaScript and is readable by anyone in DevTools. Edge Function Secrets are only accessible server-side.Emit events from your app
Create a Supabase Edge Function
Create a track-event Edge Function. Lovable's AI can write this for you — just describe what you want.
import { serve } from "https://deno.land/std@0.168.0/http/server.ts";
serve(async (req) => {
const { name, contactEmail, contactName, properties } = await req.json();
const res = await fetch("https://api.wraps.dev/v1/events/", {
method: "POST",
headers: {
Authorization: `Bearer ${Deno.env.get("WRAPS_API_KEY")}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
name,
contactEmail,
contactName,
createIfMissing: true,
properties,
}),
});
const data = await res.json();
return new Response(JSON.stringify(data), {
headers: { "Content-Type": "application/json" },
});
});Call it when things happen in your app
From your Lovable frontend, call the Edge Function when events occur:
import { supabase } from "@/lib/supabase";
// When a user signs up
await supabase.functions.invoke("track-event", {
body: {
name: "user.signed_up",
contactEmail: user.email,
contactName: user.name,
properties: { plan: "free", source: "lovable" },
},
});
// When an order is placed
await supabase.functions.invoke("track-event", {
body: {
name: "order.placed",
contactEmail: user.email,
properties: { orderId: order.id, amount: order.total },
},
});Set up a workflow in Wraps
In the Wraps dashboard, create a workflow with an event trigger set to your event name (e.g. user.signed_up). Add a Send Email step with your template. That's it — every time your app emits that event, Wraps sends the email.
- 1Dashboard → Workflows → New workflow
- 2Trigger: Event received → event name: user.signed_up
- 3Step: Send email → choose your template
Common events to track
| Event | Triggers |
|---|---|
user.signed_up | Welcome email |
order.placed | Order confirmation |
password.reset_requested | Password reset email |
subscription.cancelled | Win-back sequence |
trial.ending | Upgrade nudge |
FAQ
Run npx @wraps.dev/cli email init to set up SES, then wraps platform connect to give Wraps permission to send through your SES in workflows. After that, your app calls api.wraps.dev directly — no Lambda deploy needed.
Ready to Connect Your Lovable App?
Emit events from Lovable. Wraps sends the emails. Your app stays clean.

