You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/connections/sources/catalog/libraries/mobile/react-native/index.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -692,5 +692,34 @@ import {
692
692
}
693
693
}
694
694
```
695
+
### How do I add to the context Object?
696
+
Similar to the integrations object above you'll need to use a plugin to access and modify the context object. For example, if you'd like to add `context.groupId` to every Track call this can be added like so:
697
+
```js
698
+
//in AddToContextPlugin.js
699
+
import {
700
+
Plugin,
701
+
PluginType,
702
+
SegmentEvent,
703
+
} from'@segment/analytics-react-native';
704
+
705
+
exportclassAddToContextPluginextendsPlugin {
706
+
// Note that `type` is set as a class property
707
+
// If you do not set a type your plugin will be a `utility` plugin (see Plugin Types above)
0 commit comments