Skip to content

[Replay] Allow using replay without installing @sentry/replay #6326

Closed
@mydea

Description

@mydea

Currently, in order to use replay you have to run:

yarn add @sentry/replay

And then use it in your codebase like this:

import * as Sentry from '@sentry/browser';
import { Replay } from '@sentry/replay';

Sentry.init({
  dsn: '__DSN__',
  integrations: [
    new Replay({})
  ],
});

We want to simplify this, so the user can do e.g.:

import * as Sentry from '@sentry/browser';

Sentry.init({
  dsn: '__DSN__',
  integrations: [
    new Sentry.Replay({})
  ],
});

And does not need to run yarn add @sentry/replay at all.

Goals

  • We do not affect bundle size for users who do not enable replay via CDN
  • We do not affect bundle size for users who do not enable replay via a bundler with tree shaking
  • This should happen in a backwards-compatible way (e.g. in 7.x)
  • Ideally, users that have replay currently setup with the manual import from @sentry/replay can continue using this for the forseeable time

Non-goals

  • For users that have, for whatever reason, no tree shaking, the bundle size may increase

Related

We may want to do the same for @sentry/tracing in the future.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions