diff --git a/docs/platforms/javascript/common/apis.mdx b/docs/platforms/javascript/common/apis.mdx index 2aab62f2e5b69..1358e506b0023 100644 --- a/docs/platforms/javascript/common/apis.mdx +++ b/docs/platforms/javascript/common/apis.mdx @@ -712,6 +712,39 @@ See Tracing Instrumentation + + + Signals to the Sentry SDK that the initial page was fully loaded. + Requires the `enableReportPageLoaded` option in `browserTracingIntegration` to + be set to `true`. Once called, the SDK ends the pageload span automatically, + + By default, the SDK takes care of ending the pageload span automatically, based on + a period of inactivity where no new child spans are added to the pageload trace. + You can alternatively use explicit pageload reporting if the inactivity heuristics of + `browserTracingIntegration` don't work well for your use case. + However, you must ensure that you call `reportPageLoaded` in every situation. + If `reportPageLoaded` is not called, the pageload span will be ended after 30 seconds + or whatever custom value is set on the `finalTimeout` option. + + + + ```javascript + Sentry.init({ + // 1. Enable manual page load reporting: + integrations: [browserTracingIntegration({ enableReportPageLoaded: true })] + }) + + // 2. Whenever you consider the page loaded: + Sentry.reportPageLoaded(); + ``` + + + ## Tracing Utilities These utilities can be used for more advanced tracing use cases. diff --git a/docs/platforms/javascript/common/tracing/instrumentation/automatic-instrumentation.mdx b/docs/platforms/javascript/common/tracing/instrumentation/automatic-instrumentation.mdx index 1b19f192405b1..e5d20bb23f4f4 100644 --- a/docs/platforms/javascript/common/tracing/instrumentation/automatic-instrumentation.mdx +++ b/docs/platforms/javascript/common/tracing/instrumentation/automatic-instrumentation.mdx @@ -131,6 +131,13 @@ This flag enables or disables creation of `pageload` span on first pageload. + + + +This option determines whether the `Sentry.reportPageLoaded()` function is enabled. + + + This option flags pageload/navigation spans when tabs are moved to the background with "cancelled". Because browser background tab timing is not suited for precise measurements of operations and can affect your statistics in nondeterministic ways, we recommend that this option be enabled. diff --git a/src/components/sdkApi.tsx b/src/components/sdkApi.tsx index 9272dd71e4a22..761bd78214465 100644 --- a/src/components/sdkApi.tsx +++ b/src/components/sdkApi.tsx @@ -26,6 +26,7 @@ type Props = { name: string; parameters: ParameterDef[]; signature: string; + availableSince?: string; categorySupported?: PlatformCategory[]; children?: React.ReactNode; language?: string; @@ -35,6 +36,7 @@ export function SdkApi({ name, children, signature, + availableSince, parameters = [], language, categorySupported = [], @@ -51,9 +53,12 @@ export function SdkApi({ {showServerLikeOnly && (
Only available on Server
)} -
{codeToJsx(signature, lang)}
- + {availableSince && ( +

+ Available Since: {availableSince} +

+ )} {parameters.length ? (
@@ -63,7 +68,6 @@ export function SdkApi({
) : null} - {children} );