Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

braze-api

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

braze-api

Track users, send messages, export data, and more with Braze API.

  • 2.9.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11K
decreased by-0.02%
Maintainers
1
Weekly downloads
 
Created
Source

braze-api

NPM

NPM version build codecov NPM downloads

Node.js library for Braze. See docs and demo. The types are from 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

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:

InstanceREST Endpoint
US-01https://rest.iad-01.braze.com
US-02https://rest.iad-02.braze.com
US-03https://rest.iad-03.braze.com
US-04https://rest.iad-04.braze.com
US-05https://rest.iad-05.braze.com
US-06https://rest.iad-06.braze.com
US-08https://rest.iad-08.braze.com
EU-01https://rest.fra-01.braze.eu
EU-02https://rest.fra-02.braze.eu

API Key

The API key can be created in your Braze dashboard.

API Methods

The library supports the following Braze API endpoints. Pull requests are welcome!

Campaigns

  • /campaigns/data_series
  • /campaigns/details
  • /campaigns/list
  • /sends/data_series

Canvas

  • /canvas/data_series
  • /canvas/data_summary
  • /canvas/details
  • /canvas/list

Catalogs

  • DELETE /catalogs/{catalog_name}/items
  • PATCH /catalogs/{catalog_name}/items
  • POST /catalogs/{catalog_name}/items
  • PUT /catalogs/{catalog_name}/items/
  • DELETE /catalogs/{catalog_name}/items/{item_id}
  • GET /catalogs/{catalog_name}/items/{item_id}
  • GET /catalogs/{catalog_name}/items
  • PATCH /catalogs/{catalog_name}/items/{item_id}
  • POST /catalogs/{catalog_name}/items/{item_id}
  • PUT /catalogs/{catalog_name}/items/{item_id}
  • DELETE /catalogs/{catalog_name}
  • GET /catalogs
  • POST /catalogs

Content Blocks

  • /content_blocks/list
  • /content_blocks/info
  • /content_blocks/create
  • /content_blocks/update

Custom Events

  • /events/list
  • /events/data_series

Email List

  • /email/hard_bounces
  • /email/unsubscribes
  • /email/blacklist
  • /email/status
  • /email/bounce/remove
  • /email/spam/remove

Email Templates

  • /templates/email/list
  • /templates/email/info
  • /templates/email/create
  • /templates/email/update

KPI

  • /kpi/new_users/data_series
  • /kpi/dau/data_series
  • /kpi/mau/data_series
  • /kpi/uninstalls/data_series

News Feed

  • /feed/data_series
  • /feed/details
  • /feed/list

Purchases

  • /purchases/product_list
  • /purchases/quantity_series
  • /purchases/revenue_series

Preference Center

  • /preference_center/v1/{preferenceCenterExternalId}/url/{userId}
  • /preference_center/v1/list
  • /preference_center/v1/{preferenceCenterExternalId}
  • /preference_center/v1
  • /preference_center/v1/{preferenceCenterExternalId}

Schedule Messages

  • /messages/scheduled_broadcasts
  • /messages/schedule/delete
  • /canvas/trigger/schedule/delete
  • /campaigns/trigger/schedule/delete
  • /messages/schedule/create
  • /campaigns/trigger/schedule/create
  • /messages/schedule/update
  • /campaigns/trigger/schedule/update
  • /canvas/trigger/schedule/create
  • /canvas/trigger/schedule/update

SCIM

  • DELETE /scim/v2/Users/{id}
  • GET /scim/v2/Users?filter={userName@example.com}
  • GET /scim/v2/Users/{id}
  • POST /scim/v2/Users
  • PUT /scim/v2/Users/{id}

Segments

  • /segments/list
  • /segments/data_series
  • /segments/details
  • /sessions/data_series

Send Messages

  • /sends/id/create
  • /messages/send
  • /transactional/v1/campaigns/{{CAMPAIGN_ID}}/send
  • /campaigns/trigger/send
  • /canvas/trigger/send

SMS

  • /sms/invalid_phone_numbers
  • /sms/invalid_phone_numbers/remove

Subscription Groups

  • /subscription/status/get
  • /subscription/user/status
  • /subscription/status/set
  • /v2/subscription/status/set

User Data

  • /users/export/global_control_group
  • /users/export/ids
  • /users/export/segment
  • /users/external_ids/remove
  • /users/external_ids/rename
  • /users/alias/new
  • /users/delete
  • /users/identify
  • /users/track
  • /users/alias/update
  • /users/merge

Live Activity

  • /messages/live_activity/update

Contributing

Contributions are welcome! Check out the guide. 👋

License

MIT

Keywords

FAQs

Package last updated on 11 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc