The `braze-api` library provides a community-maintained Node.js client for interacting with the Braze customer engagement platform's REST API. It allows developers to track user events, send targeted messages (email, push, in-app), export data, manage campaigns and canvases, and interface with other core Braze functionalities. The current stable version is 2.13.2 (as of November 2025), with frequent patch and minor releases, indicating active development. A key differentiator is its comprehensive TypeScript type definitions, which are derived from Braze's official Postman collection [3, 14], offering strong type safety for API requests and responses. While not officially endorsed by Braze, Inc. [3, 14], it aims to provide a robust, well-typed abstraction over the direct REST calls, simplifying integration for Node.js applications and supporting modern JavaScript features since Node.js 14. [4]
npm install braze-apiVerified import paths — ran on the pinned version, not inferred.
This quickstart initializes the Braze client and sends a transactional email to a user identified by `external_user_id` using a pre-configured email template. It demonstrates basic client instantiation and calling a messaging endpoint.
Ensure your organization's support strategy accounts for using a community-maintained client or consider direct API integration if official vendor support is paramount.
Verify your Braze dashboard's REST endpoint and API key. Store credentials securely using environment variables or a secrets manager. [2, 4, 14]
Implement client-side rate limiting, batch requests when possible (up to 50 recipients per `/messages/send` request), and use exponential backoff for retries on transient API errors. [4, 7]
Always store API keys securely (e.g., environment variables, secret managers) and never commit them to version control. Restrict key permissions to the minimum necessary actions. [4]
To create new users or ensure user existence before sending, use the `/users/track` endpoint first, or consider using API-triggered campaigns where user creation might be handled differently. [7, 8]
Ensure the `BRAZE_API_KEY` is correct and has the necessary permissions configured in your Braze dashboard. Check for leading/trailing spaces or typos.
For ES Modules (recommended): `import { Braze } from 'braze-api';`. For CommonJS: `const { Braze } = require('braze-api');`.Verify `BRAZE_API_URL` against the official Braze documentation for your specific instance (e.g., `https://rest.iad-01.braze.com`). Check network proxy or firewall settings if applicable. [2, 14]
Consult the Braze API documentation for the specific endpoint you are calling (e.g., `/messages/send`) to ensure all required fields are present and correctly formatted in your request payload. [5, 6, 8]
No dependency data recorded yet.