Skip to content

Commit 15ede7d

Browse files
author
Niall Brennan
committed
add integration object info
1 parent 3eb5950 commit 15ede7d

File tree

1 file changed

+27
-0
lines changed
  • src/connections/sources/catalog/libraries/mobile/react-native

1 file changed

+27
-0
lines changed

src/connections/sources/catalog/libraries/mobile/react-native/index.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,5 +612,32 @@ const segmentClient = createClient({
612612
```
613613
### What is the instanceId set in context?
614614
The instanceId was introduced in [V 2.10.1](https://github.com/segmentio/analytics-react-native/releases/tag/%40segment%2Fanalytics-react-native-v2.10.1) and correlates events to a particular instance of the client in a scenario when you might have multiple instances on a single app.
615+
616+
### How do I interact with the integrations object?
617+
The integrations object is no longer part of the Segment events method signature. To access the integrations object, in order to control what destinations the event reaches, you can instead use a Plugin:
618+
619+
```js
620+
import {
621+
EventType,
622+
Plugin,
623+
PluginType,
624+
SegmentEvent,
625+
} from '@segment/analytics-react-native';
626+
627+
export class Modify extends Plugin {
628+
type = PluginType.before;
629+
630+
async execute(event: SegmentEvent) {
631+
if (event.type == EventType.TrackEvent) {
632+
let integrations = event.integrations;
633+
if (integrations !== undefined) {
634+
integrations['Appboy'] = false;
635+
}
636+
}
637+
//console.log(event);
638+
return event;
639+
}
640+
}
641+
```
615642
## Changelog
616643
[View the Analytics React Native 2.0 changelog on GitHub](https://github.com/segmentio/analytics-react-native/releases){:target="_blank"}.

0 commit comments

Comments
 (0)