segmentio / analytics-react-native

The hassle-free way to add analytics to your React-Native app.
https://segment.com/docs/sources/mobile/react-native/
MIT License
354 stars 182 forks source link

feat: add property to disable segment client #847

Closed AlexanderEggers closed 3 months ago

AlexanderEggers commented 1 year ago

Summary

This PR adds a new property to disable the segment client as if the client was never set. That can be useful in the scenario when no segment related calls should be made while running in the debug mode.

This change modifies the return type of the createClient function which can be an undefined object now. I believe the impact should be something users can fix quickly but this feature could help people avoid sending not needed debug scenarios to segment.

jacquesdev commented 9 months ago

Wow this will be very helpful!