braze-api
Node.js library for Braze (see demo). The types are inspired by Braze's Postman collection.
Quick Start
import { Braze } from 'braze-api'
const braze = new Braze('YOUR_API_URL', 'YOUR_API_KEY')
await braze.messages.send({
external_user_ids: ['your_external_user_id'],
messages: {
email: {
app_id: 'your_app_id',
from: 'Company <company@example.com>',
email_template_id: 'your_email_template_id',
},
},
})
Documentation
See Braze API guide and Braze's Postman collection.
Prerequisites
Installation
NPM:
npm install braze-api
Yarn:
yarn add braze-api
Usage
The package needs to be configured with your account's REST endpoint and API key:
const { Braze } = require('braze-api')
const braze = new Braze('YOUR_API_URL', 'YOUR_API_KEY')
The same can be done with ES Modules:
import { Braze } from 'braze-api'
const braze = new Braze('YOUR_API_URL', 'YOUR_API_KEY')
API URL
Use the REST endpoint provisioned to your account when you log in to the dashboard:
API Key
The API key can be created in your Braze dashboard.
API Methods
This library currently supports a subset of the Braze API endpoints. Pull requests are welcome.
User data
Send messages
Schedule messages
Subscription groups
Email and email templates
Campaigns
Canvas
Segments
Custom events
Content Blocks
KPI
News Feed
SMS
Purchases
Release
Release is automated with Release Please.
License
MIT