sentry-react-native icon indicating copy to clipboard operation
sentry-react-native copied to clipboard

Programatically start recording.

Open DeanGracey opened this issue 11 months ago • 10 comments

It doesn't seem possible to start a new recording session using the react native package as one can using the javascript package, i.e:

// You can access the active replay instance from anywhere in your code like this:
const replay = Sentry.getReplay();

// This starts in `session` mode, regardless of sample rates
replay.start();

I would like to start recording sessions based on the value of a feature flag, so I don't just want a sample rate as set in the Sentry.init call:

_experiments: {
      replaysSessionSampleRate: 1,
      replaysOnErrorSampleRate: 1,
    },

Am I missing something or is this something that could be supported in the future?

DeanGracey avatar Jan 14 '25 10:01 DeanGracey

Hi @DeanGracey, thank you for using/trying our Mobile Session Replay.

Programmatic control (same as in JS replay.start()) of mobile replays is on our backlog and is definitely coming.

Let us know if you have any more question about Mobile Replay.

krystofwoldrich avatar Jan 15 '25 14:01 krystofwoldrich

https://sentry.zendesk.com/agent/tickets/143686

cobyeastwood183 avatar Jan 29 '25 23:01 cobyeastwood183

👍 This is also a must-have feature for my use case. I don't want to negatively impact all users by enabling this, and I want to record all user sessions only when they start a specific user flow.

chrstophg avatar Jun 20 '25 08:06 chrstophg

Same here. We would highly appreciate this feature 👍

We have users with bad performing devices. Letting the session run all the time, might drop them out of the "smooth" performance.

So we want to let the users

  • trigger the session on their own and record buggy behavior
  • just opt-in for all the time running session (when their device is performant enough)

Off Topic: Just a "Thank You!" for this great project! You saved us a lot of time investigating and staying sane in hard times 👍 (a quick look in transactions tells us - all things are running smooth on the client side - and we are not dependent on (never happening) positive feedback of users 😅 )

andyl-ioki avatar Jun 23 '25 08:06 andyl-ioki

Thanks for the feedback, we will keep you up-to-date once we have news on this!

buenaflor avatar Jun 24 '25 12:06 buenaflor

Adding in a specific use-case that came up recently:

  • Defer the initialization of the Sentry SDK, so they can enable Session Replay only for a specific user that is identified via feature flag; for troubleshooting purposes

jas-kas avatar Aug 07 '25 15:08 jas-kas

We would really appreciate having this feature as well. It would greatly help us debug issues for specific clients and provide significant support in identifying sensitive situations. Having this capability would make a big difference for us. Thank you in advance for considering it!

ConstantinBiserica avatar Aug 25 '25 12:08 ConstantinBiserica

https://sentry.zendesk.com/agent/tickets/161534

cobyeastwood183 avatar Sep 24 '25 18:09 cobyeastwood183