getsentry / getsentry/sentry-javascript

Allow to send session sessions when using a client manually

Abierto
#14,804 16 comentarios 0 reacciones 0 asignados Ver en GitHub
Browser Feature
Lenguaje dominante
TypeScript
Estrellas
8.7k
Forks
1.8k
Merge medio
1 d 17 h
PR fusionados (30 d)
515

Descripción

### 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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.