Get started
Introduction
Choose a sender for the channel and a transport for the provider.
sently sends email, SMS, WhatsApp, and push (Web Push or FCM) without making provider SDK calls your application API. Choose the channel sender first, then attach the provider transport that performs delivery.
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.