Analytics React Native Braze Middleware Plugin
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 on GitHub in the @segmentio/analytics-react-native.
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.
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 on the main Analytics client:
In your code where you initialize the analytics client call the .add(plugin) method with an BrazeMiddlewarePlugin instance:
1import { createClient } from '@segment/analytics-react-native';23import { BrazeMiddlewarePlugin } from '@segment/analytics-react-native-plugin-braze-middleware';45const segmentClient = createClient({6writeKey: 'SEGMENT_KEY'7});89segmentClient.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.