Analytics React Native Braze Middleware Plugin


On this page


Braze, formerly Appboy, is an engagement platform that empowers growth by helping marketing teams to build customer loyalty through mobile, omni-channel customer experiences.

Braze’s middleware plugin code is open source and available on GitHub. You can view it here.

The Braze middleware plugin is a BeforePlugin used to debounce identify events for Braze. This Plugin should be used with a Cloud Mode connection to Braze. To connect to Braze with a Device Mode connection use the Braze Destination Plugin instead. It is not possible to use both plugins in one Analytics React Native instance.

Installation

You need to install the @segment/analytics-react-native-plugin-braze-middleware.

Using NPM:

npm install --save @segment/analytics-react-native-plugin-braze-middleware 

Using Yarn:

yarn add @segment/analytics-react-native-plugin-braze-middleware

Usage

Follow the instructions for adding plugins on the main Analytics client:

In your code where you initialize the analytics client call the .add(plugin) method with an BrazeMiddlewarePlugin instance:

import { createClient } from '@segment/analytics-react-native';

import { BrazePlugin } from '@segment/analytics-react-native-plugin-braze-middleware';

const segmentClient = createClient({
  writeKey: 'SEGMENT_KEY'
});

segmentClient.add({ plugin: new BrazeMiddlewarePlugin() });

Once enabled, this plugin will make it possible to use Braze with a Cloud Mode connection while limiting the number of identify calls from the client.

This page was last modified: 08 Jun 2023



Get started with Segment

Segment is the easiest way to integrate your websites & mobile apps data to over 300 analytics and growth tools.
or
Create free account