Skip to content

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.

4 participants