-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Description
Core or SDK?
Platform/SDK
Which part? Which one?
Javascript
Description
Per our client:
"The real problem here is that BrowserClient accepts an initialScope parameter in its constructor and in its TypeScript types but does not actually do anything with it, leading to confusion. This is likely something that should be fixed by either not accepting the initialScope parameter in BrowserClient, or by actually acting on the initialScope parameter.
Once I looked at the source code and discovered that initialScope does nothing, I figured out the rest.
At least documenting this solution for capturing user sessions with BrowserClient on the docs site would be helpful."
Suggested Solution
Add a reference for when using BrowserClient with a code sample like this one:
const initialScope = new Sentry.Scope();
initialScope.update({
user: { id: '1234-test' },
});
const sentryHub = new Sentry.Hub(sentryClient, initialScope);
sentryHub.startSession();
sentryHub.captureSession();
ba0708
Metadata
Metadata
Assignees
Labels
No labels