Back to selected work

TypedMailer · Case study

One typed contract for seven email providers

A server-side TypeScript library that keeps provider-specific email behavior behind a small, replaceable adapter boundary.

  • TypeScript
  • Node.js
  • Provider adapters

Challenge

Transactional email code can become coupled to one provider SDK. Changing providers then spreads provider-specific request and response shapes through application features.

Approach

  • Keep one typed send API in front of adapters for Resend, Brevo, Postmark, SendGrid, Mailgun, Amazon SES, and SMTP.
  • Load provider SDKs as optional peers so an application installs only the adapter it selects.
  • Keep templates, queues, retries, persistence, and business rules in the host application.
  • Expose inbound webhook verification and normalization through a separate entry point, without taking ownership of routing or event processing.

What the implementation shows

  • The same createMailer/send contract covers all seven documented providers.
  • Provider contract docs and integration smoke workflows make adapter expectations and their coverage inspectable.
  • The package is published as typedmailer for trusted server-side Node.js runtimes.
Explore the source on GitHub