@sentry/core
Version:
Base implementation for all Sentry JavaScript SDKs
29 lines (28 loc) • 746 B
JavaScript
import { getTraceData } from "./traceData.js";
// src/utils/meta.ts
/**
* Returns a string of meta tags that represent the current trace data.
*
* You can use this to propagate a trace from your server-side rendered Html to the browser.
* This function returns up to two meta tags, `sentry-trace` and `baggage`, depending on the
* current trace data state.
*
* @example
* Usage example:
*
* ```js
* function renderHtml() {
* return `
* <head>
* ${getTraceMetaTags()}
* </head>
* `;
* }
* ```
*
*/
function getTraceMetaTags(traceData) {
return Object.entries(traceData || getTraceData()).map(([key, value]) => `<meta name="${key}" content="${value}"/>`).join("");
}
export { getTraceMetaTags };
//# sourceMappingURL=meta.js.map