The Brevo Node.js SDK (@getbrevo/brevo) is a TypeScript-first client library for the Brevo API. It provides:
BrevoClient with namespaced service clientsVersion 6.0 introduces breaking changes versus v5.x. v5.x remains supported and continues to receive wire-compatibility fixes — see the changelog for the list of changes and the README for migration steps.
Initialize the client and send your first email:
Pass options to the constructor to configure timeout, retries, and other settings:
The SDK throws typed error classes based on HTTP status codes:
All BrevoError instances expose:
statusCode — HTTP status codemessage — Error messagebody — Parsed response bodyrawResponse — Raw response with headersAutomatic retries with exponential backoff are enabled by default (2 retries). Configure at the client or request level:
408, 429, 500, 502, 503, 504Retry-After response headerDefault timeout is 60 seconds. Configure at the client or request level:
All service methods accept a request options object as the final argument:
Cancel in-flight requests using the Web AbortController API:
Access response headers and metadata via .withRawResponse():
Endpoints that return binary content (e.g., attachment downloads) expose multiple consumption methods:
All request and response types are exported from the package:
Configure logging to inspect outgoing requests and responses:
Integrate with any logging library by implementing the ILogger interface:
Override the default fetch implementation for any runtime or to add request interceptors:
The BrevoClient exposes the following service namespaces: