Skip to content

feat(replay): Add getReplay utility function #10510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 7, 2024
Merged

feat(replay): Add getReplay utility function #10510

merged 2 commits into from
Feb 7, 2024

Conversation

mydea
Copy link
Member

@mydea mydea commented Feb 6, 2024

As pointed out here, and I also did notice that myself, it is not super nice - as you need to provide a generic integration to getIntegrationByName, which is annoying to do in a type safe way, esp. if you want to avoid deprecations:

const client = getClient();
const replay = client && client.getIntegrationByName && client.getIntegrationByName<ReturnType<typeof replayIntegration>>('Replay');

So IMHO a small utility Sentry.getReplay() is not unreasonable for this 🤔

@mydea mydea requested a review from billyvg February 6, 2024 08:28
@mydea mydea self-assigned this Feb 6, 2024
@mydea mydea merged commit b1b704f into develop Feb 7, 2024
@mydea mydea deleted the fn/getReplay branch February 7, 2024 12:29
mydea added a commit that referenced this pull request Feb 12, 2024
As pointed out here, and I also did notice that myself, it is not super
nice - as you need to provide a generic integration to
`getIntegrationByName`, which is annoying to do in a type safe way, esp.
if you want to avoid deprecations:

```ts
const client = getClient();
const replay = client && client.getIntegrationByName && client.getIntegrationByName<ReturnType<typeof replayIntegration>>('Replay');
```

So IMHO a small utility `Sentry.getReplay()` is not unreasonable for
this 🤔
@mydea mydea mentioned this pull request Feb 12, 2024
@pckilgore
Copy link

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants