Skip to content

Add the ability to manually start Replays with the Loader Script #13818

@jgs-thg

Description

@jgs-thg

Problem Statement

I want to be able to start Replays manually, while using the Loader Script. As far as I could gather from a question I asked on the Discord, and your documentation, this function getReplay() on Sentry, is not available while using the Loader Script, even though it is not explicitly stated in the documentation.
I would prefer if the ability to manually start replays were added, as I am unable to run the npm package version of Sentry, as I do not have early enough access to a nodejs package manager.

Setup:

window.sentryOnLoad = function () {
  Sentry.init({
    dsn: "...",
    replaysSessionSampleRate: 0,
    replaysOnErrorSampleRate: 0,
    integrations: [
      Sentry.replayIntegration(),
    ],
});

Script source

<script src="sentry_url" crossorigin="anonymous" data-lazy="no"></script>```

```javascript
window.Sentry && Sentry.onLoad(function () {
  const replay = Sentry.getReplay();
});

Error caused by using getReplay():

TypeError: Sentry.getReplay is not a function

Solution Brainstorm

Add the ability to manually start a Replay recording using getReplay() while using the Loader Script.

Product Area

Replays

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: replayIssues related to the Sentry Replay SDK

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions