Skip to contentSkip to navigationSkip to topbar
On this page
Looking for more inspiration?Visit the
(information)
You're in the right place! Segment documentation is now part of Twilio Docs. The content you are used to is still here—just in a new home with a refreshed look.

Analytics React Native Braze Middleware Plugin


Braze(link takes you to an external page), 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 on GitHub in the @segmentio/analytics-react-native(link takes you to an external page).

The Braze middleware plugin is a BeforePlugin used to debounce identify events for Braze(link takes you to an external page). 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(link takes you to an external page) instead. It is not possible to use both plugins in one Analytics React Native instance.


Installation

installation page anchor

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

Follow the instructions for adding plugins(link takes you to an external page) on the main Analytics client:

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

1
import { createClient } from '@segment/analytics-react-native';
2
3
import { BrazeMiddlewarePlugin } from '@segment/analytics-react-native-plugin-braze-middleware';
4
5
const segmentClient = createClient({
6
writeKey: 'SEGMENT_KEY'
7
});
8
9
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.