I would like to use scope.applyToEvent(event)
to not manually configure the showReportDialog()
options, like the user.
I figured out with Sentry.lastEventId();
you can get the last event id.
However applyToEvent
requires an Event.
In theory:
Sentry.captureMessage(msg, Severity.Critical);
// I should have an eventId now, right?
const eventId = Sentry.lastEventId(); // I can do this but this doesn't help a lot
// Add scope to event (in theory).
Sentry.withScope(scope => {
scope.applyToEvent($sentryEvent); // How to get this event?
});
// User report modal.
Sentry.showReportDialog({
eventId: eventId,
// user: {
// email: 'something',
// name: 'something'
// }
// I don't want to set these again
});
I only found this test, but the event
is build manually there.
How to get the last Event Object?
Did I miss any documentation or is there a different solution?