Installation
Quick Start
Authentication
Get your API key from Settings > API Keys in the Courier dashboard. Set it as an environment variable:Sending Notifications
With a template
Design your notification in Design Studio, then reference it by ID:With inline content
Skip templates and define content directly in code:To multiple recipients
Send to a list of users in a single call:Available Resources
The SDK covers the full Courier API. Every method is typed and documented in your editor on hover.Common Operations
Checking Message Status
After sending, use therequestId to check delivery status or get the full event timeline:
Managing User Profiles
Profiles store recipient data (email, phone, custom fields) that Courier uses for delivery. You need a profile before you can send to auser_id.
create merges with any existing profile. Use replace for a full overwrite (any fields not included will be removed).Issuing JWT Tokens
If you use Courier’s client-side SDKs (React, JavaScript, mobile), your backend needs to issue JWT tokens for user authentication. Theauth.issueToken method handles this:
scope string controls what the token can access. Common scopes:
Bulk Sending
For large recipient lists, use the bulk API. It works in three steps: create a job, add users, then run it.TypeScript Types
The SDK ships with full TypeScript definitions for every request and response. Import them directly:Configuration
Error Handling
The SDK throws typed errors for API failures. All errors extendCourier.APIError:
Retries
The SDK automatically retries failed requests up to 2 times with exponential backoff. Retried errors include connection failures, 408, 409, 429, and 5xx responses.Timeouts
Requests time out after 60 seconds by default. Configure globally or per-request:APIConnectionTimeoutError is thrown. Timed-out requests are retried by default.
Logging
Enable debug logging with theCOURIER_LOG environment variable or the logLevel client option:
debug level, all HTTP requests and responses are logged including headers and bodies. You can also pass a custom logger (pino, winston, etc.):
Raw Response Access
Access HTTP headers or the underlyingResponse object:
Journeys
Journeys are multi-step workflows (send, delay, branch, throttle, digest, and more). Invoke one by ID or alias to start a run, then cancel runs by ID or a shared cancelation token.cancel takes exactly one of run_id or cancelation_token (spelled with one “l”). You can also build and manage journeys from code with client.journeys.create, list, publish, and archive. See Build journeys via API.More Operations
The SDK covers the full Courier REST API. Here are a few more resources beyond what’s documented above:API Reference
Full REST API docs with request/response examples.
Send API
Learn about the Send endpoint, routing, and message options.
Quickstart
Send your first notification in under two minutes.
GitHub
Source code, issues, and changelog.