File conventions
Client instrumentation
Place lightweight synchronous startup code in instrumentation-client.ts at the project root (or src root). It runs early in the browser; async imports and promises need not finish before React hydration. This local mark is not a measure of interactivity or an external telemetry upload. Source: https://nextjs.org/docs/app/api-reference/file-conventions/instrumentation-client. Documentation-reviewed illustrative draft; installed declarations and runtime not verified.
Formal Syntax & Structure
nextjs syntaxnextjs
instrumentation-client.tsWorking Example
Example Snippetnextjs
performance.mark('river-books:client-init');