How to use the logrocket.getSessionURL function in logrocket

To help you get started, we’ve selected a few logrocket examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wearekickback / app / src / api / logRocket.js View on Github external
export const setup = () => {
  if (LOGROCKET_TOKEN) {
    LogRocket.init(LOGROCKET_TOKEN)
  }
  // add to rollbar
  if (typeof window.Rollbar === 'undefined') {
    console.warn(
      'Rollbar not setup, so cannot assign LogRocket session to Rollbar instance!'
    )
  } else {
    LogRocket.getSessionURL(sessionURL => {
      window.Rollbar.configure({
        transform: obj => {
          obj.sessionURL = sessionURL
        }
      })
    })
  }
}
github OperationCode / front-end / pages / _app.js View on Github external
componentDidMount() {
    /* Analytics */
    // Temporary method until we do dynamic now configs
    if (isProduction && window.location.host.includes('operationcode.org')) {
      Sentry.init({ dsn: clientTokens.SENTRY_DSN, release: `front-end@${version}` });
      LogRocket.init(`${clientTokens.LOGROCKET}/operation-code`);
      ReactGA.initialize(clientTokens.GOOGLE_ANALYTICS);

      // Every crash report will have a LogRocket session URL.
      LogRocket.getSessionURL(sessionURL => {
        Sentry.configureScope(scope => {
          scope.setExtra('sessionURL', sessionURL);
        });
      });

      setupLogRocketReact(LogRocket);

      // Per library docs, Fingerprint2 should not run immediately
      if (window.requestIdleCallback) {
        requestIdleCallback(setLogRocketFingerprint);
      } else {
        setTimeout(setLogRocketFingerprint, 500);
      }

      ReactGA.set({ page: window.location.pathname });
    }

logrocket

JavaScript SDK for [LogRocket](https://logrocket.com/)

MIT
Latest version published 2 months ago

Package Health Score

68 / 100
Full package analysis