Skip to content

Sentry.getTraceData is not exported from @sentry/react #16418

Closed

Description

@nbbeeken

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@9.5.0 @sentry/react@9.5.0

Framework Version

React 17.0.2

Link to Sentry event

No response

Reproduction Example/SDK Setup

Under the "How Sampling Propagates in Distributed Traces" on the linked docs page. The code sample is

// Extract trace data from the current scope
const traceData = Sentry.getTraceData();
const sentryTraceHeader = traceData["sentry-trace"];
const sentryBaggageHeader = traceData["baggage"];

But getTraceData is not exported

Steps to Reproduce

npm i -D @sentry/react
const Sentry = await import("@sentry/react")

Expected Result

> typeof Sentry.getTraceData
'function'

Actual Result

> typeof Sentry.getTraceData
'undefined'

Activity

  1. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on May 28, 2025
  2. AbhiPrasad commented on May 30, 2025

    @AbhiPrasad
    Contributor

    Hey @nbbeeken - thanks for writing in!

    I opened #16433 to fix this.

  3. self-assigned this
    on May 30, 2025
  4. github-actions commented on Jun 3, 2025

    @github-actions
    Contributor

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #16433, which was included in the 9.25.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions