By the end of this guide, a welcome email sends automatically the moment a new user signs up — triggered by your auth provider, rendered from a dashboard template, with no copy living in your codebase. This is the email your auth provider doesn’t send for you. Clerk and Auth.js handle the auth-related mail — verification codes, magic links, password resets — but neither sends a product welcome. That gap is yours to fill, and it’s a one-lineDocumentation Index
Fetch the complete documentation index at: https://docs.senderkit.com/llms.txt
Use this file to discover all available pages before exploring further.
send() from a
webhook or event handler.
You’ll need: a SenderKit account with an API key
(create one), a Next.js app, and either a Clerk or Auth.js
(NextAuth) setup. Start with an
sk_test_ key so nothing reaches a real inbox while
you wire this up.Author the welcome template in the dashboard
In the SenderKit dashboard, create an Don’t want to start from a blank editor? Use AI authoring
to draft the subject, layout, and variables from a one-line brief, then refine and
publish.
email template with
the slug welcome. Write the subject and body, and reference your dynamic values as
variables with Mustache braces:Template copy (in the dashboard editor)
Install the SDK and configure the client
.env.local
lib/senderkit.ts
lib/email.ts
Trigger the send on signup
The SenderKit side is identical either way — the only difference is how your auth
provider tells you a user was created.
- Clerk
- Auth.js (NextAuth)
Clerk delivers signup events as webhooks (over Svix).
Add a route handler that verifies the request and calls your helper on
Then register the endpoint: Clerk Dashboard → Webhooks → Add Endpoint, point
it at
user.created:app/api/webhooks/clerk/route.ts
https://your-app.com/api/webhooks/clerk, subscribe to user.created, and
copy the Signing Secret into your environment as
CLERK_WEBHOOK_SIGNING_SECRET (verifyWebhook reads it automatically).Verify it works
With your Because the send is keyed on
sk_test_ key in place, sign up a test user (Clerk’s test tab, or a real
signup flow against your dev database for Auth.js).The send is accepted immediately and delivered asynchronously. In
test mode SenderKit synthesizes the full lifecycle —
queued → rendered → sent → delivered — without touching a provider. Confirm it in the
dashboard, or from code:welcome:${userId}, a duplicate webhook delivery (they
happen — delivery is at-least-once) collapses to the same message instead of emailing
the user twice.Go live
Swap the environment key to
sk_live_ and register a production webhook endpoint
in Clerk (or deploy your Auth.js app). No code changes — SenderKit
derives live vs. test from the key prefix, and the welcome
template you published renders for real.What’s next
Recover failed payments
The Stripe lifecycle emails Stripe doesn’t send for you.
Send team invites
Invite teammates with a tokenized accept link.
Sending
Idempotency, scheduling, and the accept-now / deliver-later model.
Messages
Track a send from queued to delivered.