Documentation
Quickstart
Send your first transactional email in 5 minutes using the official Node SDK.
Prerequisites
- Node.js 20+ installed.
- A CoffeeMail account with at least one verified domain (see Verify your domain).
- An API Key created in Dashboard → API Keys.
1. Install the SDK
.bash
@coffeemail/node ships in ESM and CommonJS with strict TypeScript and full typing.
2. Set your API key
.env.local
Create an API key in Dashboard → API Keys. Use environment variables in production — never commit the key.
3. cURL alternative (no SDK)
send.sh
Same endpoint, no dependencies. Use when outside Node.js or for one-off scripts.
4. Send your first email
send-email.ts
The SDK returns in the data, error pattern (Supabase/Resend style). Errors are typed (ValidationError, AuthenticationError, etc).
5. Track delivery
track-email.ts
data.status can be: queued, scheduled, processing, sent, delivered, bounced, complained, failed, skipped, cancelled.