How to use the @sentry/hub.setHubOnCarrier function in @sentry/hub

To help you get started, we’ve selected a few @sentry/hub 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 getsentry / sentry-javascript / packages / node / src / sdk.ts View on Github external
// Prefer env var over global
    if (process.env.SENTRY_RELEASE) {
      options.release = process.env.SENTRY_RELEASE;
    }
    // This supports the variable that sentry-webpack-plugin injects
    else if (global.SENTRY_RELEASE && global.SENTRY_RELEASE.id) {
      options.release = global.SENTRY_RELEASE.id;
    }
  }

  if (options.environment === undefined && process.env.SENTRY_ENVIRONMENT) {
    options.environment = process.env.SENTRY_ENVIRONMENT;
  }

  if (domain.active) {
    setHubOnCarrier(getMainCarrier(), getCurrentHub());
  }

  initAndBind(NodeClient, options);
}

@sentry/hub

Sentry hub which handles global state managment.

MIT
Latest version published 5 months ago

Package Health Score

93 / 100
Full package analysis