Get started
Introduction
Choose a sender for the channel and a transport for the provider.
sently is the channel-delivery layer for email, SMS, WhatsApp, and push (Web Push or FCM). Choose a channel sender first, then attach a provider transport — so adding SMS or push later does not invent a new error and retry model in your app.
The one rule
Use
createMailer, createSmsSender, createWhatsAppSender, or createPushSender in app code; swap transports when provider configuration changes.bun add sentlyimport { createMailer } from "sently/mailer";
import { ResendTransport } from "sently/transports/resend";
const mailer = await createMailer({
transport: new ResendTransport({
apiKey: process.env.RESEND_API_KEY!,
}),
});
await mailer.send({
from: "hello@example.com",
to: "person@example.com",
subject: "Welcome",
text: "Thanks for joining.",
});Choose a channel
| Channel | Factory | Delivery contract |
|---|---|---|
createMailer / createSMTPMailer | Transport | |
| SMS | createSmsSender | SmsTransport |
createWhatsAppSender | WhatsAppTransport | |
| Push | createPushSender | PushTransport |
Email factories are asynchronous. The other channel factories return their sender synchronously; all send operations are asynchronous.
Troubleshooting
Use createSMTPMailer with SMTP host, port, and authentication. Use createMailer when you already have a transport.
Yes. Keep your channel sender calls and construct it with another transport that implements the same channel contract.