sentry-react-native
sentry-react-native copied to clipboard
React Native Sentry FullStory Integration
Any plans to support a React Native FullStory integration akin to https://github.com/getsentry/sentry-fullstory ?
Nothing on the roadmap. But we'll keep this feature request open here and track demand by watching 👍 on the issue
Appreciate the quick response!
@andaydev I'd rather move this question to https://github.com/getsentry/sentry-fullstory since I don't know how the integration works.
@kamilogorek or @AbhiPrasad do you know how this integration work on the browser SDK? what would we need to do to integrate that with the RN SDK? if it's just a session id set in the event context, that would be easy, but I believe it's not that.
if it's just a session id set in the event context, that would be easy, but I believe it's not that.
That's exactly that 😄
https://github.com/getsentry/sentry-fullstory/blob/fda19a83ba5744d94522c6631f711037b84e5b23/src/SentryFullStory.ts#L33-L72
So technically one could just:
// Install fullstory on RN App
yarn add @sentry/fullstory
// Add SentryFullStory to the integrations list during Sentry SDK init
Sentry.init({
dsn: '__DSN__',
integrations: [ new SentryFullStory('__SENTRY_ORG_SLUG__'), ],
// ...
});
@TannerLessen have you tried this?
@marandaneto Yes I tried that originally as we make use of this integration in one of our React projects. However it fails due to a dependency on @fullstory/browser, which we do not use since we leverage the React Native FullStory SDK (@fullstory/react-native)
This feature request was to have a similar integration that functions with @fullstory/react-native as opposed to @fullstory/browser.. if feasible.
Let me know how to proceed if I've missed something!
Oh I see, that makes sense, we'd need an integration for @fullstory/react-native, indeed.
I did some comparison between the react-native and browser packages and here's what I came up with as a potential solution:
- Create a new package (a clone of
@sentry/fullstory) for the react-native specific implementation (@sentry/fullstory-react-native) - Replace the browser dependencies with the
react-nativeones - There are some minor refactoring that reflects the differences between the
browserandreact-nativedependenciessrc/utils.ts:- Import the
EventHinttype from@sentry/types/typesinstead
- Import the
src/types.ts:- Remove the arg from
getCurrentSessionURL()and set the return type toPromise<string>
- Remove the arg from
src/SentryFullStory.ts:- Change both imports to
/react-native - Import
FullStoryas a default instead of* as FullStory, since that's how it's defined in thereact-nativepackage - Remove the
EventandEventHintimport statement - Remove the types of
eventandhintfrom theaddGlobalEventProcessor, let TypeScript infer them
- Change both imports to
Would it make more sense to create a completely new package named '@sentry/fullstory-react-native', or create an integration script within the react native integrations directory?
Disclaimer: At the time of writing this comment I still haven't tested the actual functionality, but I'm curious of what you think is the right approach.
I'm not sure if this would be possible, but what about decoupling the @sentry/fullstory from the @fullstory/browser. Then based on the FullstoryClient supplied the implementation could work for both browser and rn?