I want to start session replay based on some query params like this:
useEffect(() => {
const campaignId = query.campaignid;
console.log("campaign id", campaignId);
return async () => {
const replay = Sentry.getCurrentHub().getIntegration(Sentry.Replay);
if (replay) {
console.log("in replay");
// Sentry.setTag("campaignid", campaignId);
await replay.flush();
}
};
}, []);
But this is not recording the session.