message: fix: Pull rrweb configuration out of Sentry instance
  Correct an issue where `self` isnt present during the lifecycle of setupOnce, causing rrweb to sometimes record events before the Sentry instance is available.
  This also installs rrweb immediately at instantiation time for the integration.
diff: @@ -33,36 +33,37 @@ export default class SentryRRWeb {
  this.checkoutEveryNms = checkoutEveryNms || 5 * 60 * 1000;
  this.checkoutEveryNth = checkoutEveryNth;
  this.maskAllInputs = maskAllInputs;
  - }
  - public attachmentUrlFromDsn(dsn: Dsn, eventId: string) {
  - const { host, path, projectId, port, protocol, user } = dsn;
  - return `${protocol}://${host}${port !== '' ? `:${port}` : ''}${
  - path !== '' ? `/${path}` : ''
  - }/api/${projectId}/events/${eventId}/attachments/?sentry_key=${user}&sentry_version=7&sentry_client=rrweb`;
  - }
  + this.events = [];
  - public setupOnce() {
  rrweb.record({
  checkoutEveryNms: this.checkoutEveryNms,
  checkoutEveryNth: this.checkoutEveryNth,
  maskAllInputs: this.maskAllInputs,
  - emit(event: RRWebEvent, isCheckout?: boolean) {
  - const self = Sentry.getCurrentHub().getIntegration(SentryRRWeb);
  + emit: (event: RRWebEvent, isCheckout?: boolean) => {
  if (isCheckout) {
  - self.events = [event];
  + this.events = [event];
  } else {
  - self.events.push(event);
  + this.events.push(event);
  }
  },
  });
  + }
  + public attachmentUrlFromDsn(dsn: Dsn, eventId: string) {
  + const { host, path, projectId, port, protocol, user } = dsn;
  + return `${protocol}://${host}${port !== '' ? `:${port}` : ''}${
  + path !== '' ? `/${path}` : ''
  + }/api/${projectId}/events/${eventId}/attachments/?sentry_key=${user}&sentry_version=7&sentry_client=rrweb`;
  + }
  +
  + public setupOnce() {
  Sentry.addGlobalEventProcessor((event: Event) => {
  const self = Sentry.getCurrentHub().getIntegration(SentryRRWeb);
  if (!self) return;
  try {
  // short circuit if theres no events to replay
  - if (!self.events.length) return;
  + if (!this.events.length) return;
  const client = Sentry.getCurrentHub().getClient();
  const endpoint = self.attachmentUrlFromDsn(
  client.getDsn(),
  