Skip to content

v4.0.1

Choose a tag to compare

@mourraille mourraille released this 11 Feb 15:29
569cbfc

📦 Brevo Node.js SDK v4.0

Modernized, TypeScript-first rewrite of the Brevo Node.js client with improved ergonomics, reliability, and runtime support.


🚀 Highlights

  • TypeScript-first SDK with full typings and autocomplete
  • Single unified client (BrevoClient) replaces multiple API classes
  • Built-in retries + timeouts
  • Structured error handling
  • Works across modern runtimes (Node 18+, Bun, Deno, Workers, RN)
  • Legacy v3.x now maintenance-only

Added

New Client Architecture

  • Introduced BrevoClient as the single entry point
  • Namespaced APIs (e.g., brevo.transactionalEmails.*)
  • Cleaner, discoverable method structure

TypeScript Support

  • First-class typings for requests and responses
  • Better IDE autocomplete
  • Stronger compile-time safety

Reliability Features

  • Automatic retries with exponential backoff
  • Honors Retry-After headers
  • Configurable global and per-request timeouts

Error Handling

  • Typed error classes:
    • BadRequestError
    • UnauthorizedError
    • NotFoundError
    • etc.
  • Easier branching and debugging vs generic errors

Advanced Configuration

  • Custom fetch support (e.g., undici, node-fetch)
  • Custom headers
  • Abort/cancel requests via AbortController
  • Binary response support

Read more at https://developers.brevo.com/docs/api-clients/node-js