You’ll need: a SenderKit account with an API key, a Next.js
app, and a database (the examples use Postgres on Supabase or Neon). Use an
sk_test_ key while building.1
2
Add an invites table
Each invite is a row with a unique, unguessable token and a status.
3
Configure the SenderKit client
lib/senderkit.ts
4
Create the invite and send it
A server action: mint a token, persist the invite, build the accept URL, and send.
app/actions/invite.ts
5
Handle the accept link
When the invitee clicks through, validate the token, add them to the workspace, and
mark the invite consumed.
app/invite/accept/route.ts
6
Verify it works
With your
sk_test_ key, call inviteTeammate(...) from a form or a quick script and
confirm the message in the SenderKit dashboard (test mode runs the full
lifecycle without sending a real email). Copy the accept_url
from the rendered message and hit it to confirm the invitee lands in the workspace and
the row flips to accepted.Swap to an sk_live_ key to send real invites — no other change.What’s next
Notify on a database change
Fire emails straight from Supabase row changes.
Welcome on signup
Greet users the moment they join.
Variables
Conditionals and loops for richer invite copy.
Sending
Idempotency keys and the async delivery model.