One-time setup (local terminal)
wraps email init runs on your local machine. Replit doesn't need your AWS credentials — only your local terminal does, and only during this one-time setup.Set up AWS
Create an AWS account and configure the AWS CLI on your local machine. AWS setup guide →
Deploy email infrastructure
This sets up SES in your AWS account — where your emails actually send from. Your Replit app never touches AWS directly. Domain verification guide →
npx @wraps.dev/cli email init
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
Go to app.wraps.dev → Settings → API Keys and create a key named replit-app.
Add the key to Replit
In the Replit editor, click the lock icon in the left sidebar. Add:
WRAPS_API_KEY = wraps_a1b2c3d4....<hmac>
process.env in your server, but never sent to the browser or committed to the project.Emit events from your server
Install the SDK in your Replit project:
npm install @wraps.dev/client
Create a shared client module:
import { createPlatformClient } from "@wraps.dev/client";
export const wraps = createPlatformClient({
apiKey: process.env.WRAPS_API_KEY,
});Call wraps.track() from your Express routes when something meaningful happens:
import { wraps } from "./lib/wraps.js";
// Emit when a user signs up
app.post("/api/signup", async (req, res) => {
const { email, name } = req.body;
// ... create user ...
await wraps.track("user.signed_up", {
contactEmail: email,
contactName: name,
createIfMissing: true,
properties: { source: "replit", plan: "free" },
});
res.json({ success: true });
});
// Emit when an order is placed
app.post("/api/orders", async (req, res) => {
// ... process order ...
await wraps.track("order.placed", {
contactEmail: req.user.email,
properties: { orderId: order.id, amount: order.total },
});
res.json({ order });
});Set up a workflow in Wraps
In the Wraps dashboard:
- 1Dashboard → Workflows → New workflow
- 2Trigger: Event received →
user.signed_up - 3Step: Send email → choose template
See the custom events guide for the full workflow reference.
Common events to track
One event per meaningful moment. Wraps workflows handle the rest.
| Event | Sends |
|---|---|
user.signed_up | Welcome email |
order.placed | Order confirmation |
password.reset_requested | Password reset |
subscription.cancelled | Win-back sequence |
trial.ending | Upgrade nudge |
FAQ
Run wraps email init on your local machine 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 via the SDK — no Lambda deploy, no Function URL to manage.
Ready to Connect Your Replit App?
Emit your first event and let Wraps handle the rest. No email logic in your code.

