Error in React native tracker initialization with expo

We are getting the below error when using the tracker in an app code which uses expo for build
[Unhandled promise rejection: Error: createTracker: null is not an object (evaluating ‘RNSnowplowTracker.createTracker’).]
at node_modules/@snowplow/react-native-tracker/dist/index.js:1117:9 in removeTracker$1

Please suggest a way around this.

Hi @Shalini_Balakrishnan, unfortunately the React Native tracker does not support Expo because it makes use of native iOS and Android code which is not supported there. We do not currently have a solution for this use case but it is on our radar. We have considered adapting the Node.js tracker to work in this setup as that is a JavaScript-only tracker and could be adapted for Expo.

Thank you, does node package have the option to send custom headers?
The documentation for node is very basic in the snowplow site. It does not have anything on GDPR configs etc

Unfortunately, there is currently no option in the Node tracker to set custom request headers – the only way would be to provide a custom emitter, i.e., reimplement the gotEmitter one.

The Node tracker serves a different use case than the React Native and mobile trackers and that’s why it also doesn’t provide the GDPR configuration and does not automatically attach the GDPR context entity. However, you can attach the context entity manually to the events that you track by adding it in the tracker.track() calls. Here is the schema that you’d have to use in the context entity.