Analytics for React Native Destination Filters
(information)
Info
Destination filters are in beta and only available to Business Tier customers.
Use Analytics-React-Native to set up destination filters on your mobile device-mode destinations.
(warning)
Warning
You must use Analytics-React-Native version 2.9 or higher to implement destination filters.
Keep these limitations in mind when using destination filters.
To get started with destination filters on mobile device-mode destinations using Analytics-React-Native:
- Download and install the
@segment/analytics-react-native-plugin-destination-filterspackage as a dependency in your project.- Using npm:
npm install --save @segment/analytics-react-native-plugin-destination-filters
- Using yarn:
yarn add @segment/analytics-react-native-plugin-destination-filters
- Using npm:
- Follow the instructions for adding plugins on the main Analytics client.
- Add
DestinationFiltersPluginafter you create your Segment client.
1import { createClient } from '@segment/analytics-react-native';23import { DestinationFiltersPlugin } from '@segment/analytics-react-native-plugin-destination-filters';45const segmentClient = createClient({6writeKey: 'SEGMENT_KEY'7});89segmentClient.add({ plugin: new DestinationFiltersPlugin() });10segment.add({ plugin: new FirebasePlugin() })