getsentry / getsentry/sentry-javascript

Allow to send session sessions when using a client manually

Open
#14,804 16 comments 0 reactions 0 assignees View on GitHub
Browser Feature
Dominant language
TypeScript
Stars
8.7k
Forks
1.8k
Avg merge
1d 17h
Merged PRs (30d)
515

Description

### Is there an existing issue for this?

- [x] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- [x] I have reviewed the documentation https://docs.sentry.io/
- [x] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases

### How do you use Sentry?

Sentry Saas (sentry.io)

### Which SDK are you using?

@sentry/browser

### SDK Version

"@sentry/browser": "^8.47.0"

### Framework Version

_No response_

### Link to Sentry event

_No response_

### Reproduction Example/SDK Setup

```
import {
BrowserClient,
defaultStackParser,
getDefaultIntegrations,
browserSessionIntegration,
makeFetchTransport,
Scope,
} from "@sentry/browser";

// filter integrations that use the global variable
const integrations = getDefaultIntegrations({}).filter(
(defaultIntegration) => {
return !["BrowserApiErrors", "Breadcrumbs", "GlobalHandlers"].includes(
defaultIntegration.name,
);
},
);

const client = new BrowserClient({
dsn: "...",
transport: makeFetchTransport,
stackParser: defaultStackParser,
integrations: [ ...integrations, browserSessionIntegration()],
release:"directClient@1.0.0",
autoSessionTracking:true,
initialScope: {
user: { id: 42, email: "john.doe@example.com" },
},
});

const scope = new Scope();
scope.setClient(client);

client.init(); // initializing has to be done after setting the client on the scope
// rest of the logic
```

### Steps to Reproduce

1. Run a simple app with the configuration above

### Expected Result

The SDK sends release health sessions to Sentry to track release health and adoption on the Releases page.

### Actual Result

No release session event is sent to Sentry.

Explicitly setting the `browserSessionIntegration` integration and/or `autoSessionTracking` have no effect on the result, this should also be automatic when a release version is set in the init as per:
- https://docs.sentry.io/platforms/javascript/configuration/releases/#release-health

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.