traceScript

tcmts.cli.web.traceScript · #6tnqoe3y · term · runs anywhere

What a page is sent ahead of its app, for the browser runtime to go on in the trace the server began for it (the page's span is its spans' parent): nothing when tracing is off.

import type { TraceSpan } from "#codebase/tcmts/cli/web";

export function traceScript(span: TraceSpan | undefined): string {
  return span ? `<script>var __TCM_TRACE__ = "00-${span.trace}-${span.id}-01";</script>` : "";
}

uses

used by