You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Describes data located in the __NEXT_DATA__ script tag. This tag is present on every page of a Next.js app.
23
+
*/
24
+
interfaceSentryEnhancedNextDataextendsNextData{
25
+
// contains props returned by `getInitialProps` - except for `pageProps`, these are the props that got returned by `getServerSideProps` or `getStaticProps`
26
+
props: {
27
+
_sentryGetInitialPropsTraceData?: string;// trace parent info, if injected by server-side `getInitialProps`
28
+
_sentryGetInitialPropsBaggage?: string;// baggage, if injected by server-side `getInitialProps`
29
+
pageProps?: {
30
+
_sentryGetServerSidePropsTraceData?: string;// trace parent info, if injected by server-side `getServerSideProps`
31
+
_sentryGetServerSidePropsBaggage?: string;// baggage, if injected by server-side `getServerSideProps`
32
+
33
+
// The following two values are only injected in a very special case with the following conditions:
34
+
// 1. The page's `getStaticPaths` method must have returned `fallback: 'blocking'`.
35
+
// 2. The requested page must be a "miss" in terms of "Incremental Static Regeneration", meaning the requested page has not been generated before.
36
+
// In this case, a page is requested and only served when `getStaticProps` is done. There is not even a fallback page or similar.
37
+
_sentryGetStaticPropsTraceData?: string;// trace parent info, if injected by server-side `getStaticProps`
38
+
_sentryGetStaticPropsBaggage?: string;// baggage, if injected by server-side `getStaticProps`
39
+
};
40
+
};
41
+
}
42
+
43
+
interfaceNextDataTagInfo{
44
+
route?: string;
45
+
traceParentData?: TraceparentData;
46
+
baggage?: string;
47
+
params?: ParsedUrlQuery;
48
+
}
49
+
50
+
/**
51
+
* Every Next.js page (static and dynamic ones) comes with a script tag with the id "__NEXT_DATA__". This script tag
52
+
* contains a JSON object with data that was either generated at build time for static pages (`getStaticProps`), or at
53
+
* runtime with data fetchers like `getServerSideProps.`.
54
+
*
55
+
* We can use this information to:
56
+
* - Always get the parameterized route we're in when loading a page.
57
+
* - Send trace information (trace-id, baggage) from the server to the client.
// Ordering of the following shouldn't matter but `getInitialProps` generally runs before `getServerSideProps` or `getStaticProps` so we give it priority.
// Ordering of the following shouldn't matter but `getInitialProps` generally runs before `getServerSideProps` or `getStaticProps` so we give it priority.
0 commit comments