Skip to content

Allow to send session sessions when using a client manually #14804

Open
@rodolfoBee

Description

@rodolfoBee

Is there an existing issue for this?

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:"[email protected]",
  autoSessionTracking:true,
  initialScope: {
    user: { id: 42, email: "[email protected]" },
  },
});

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions