UNPKG

@usenotra/geo

Version:

Request capture SDK for AI traffic attribution and agent feedback collection

46 lines (44 loc) • 1.66 kB
interface NotraScriptOptions { /** The project's public web key, `nwk.…`. */ webKey: string; /** Load `notra.plus.js`, which also reports JavaScript errors. */ errors?: boolean; /** Count `#hash` route changes as page views. */ hash?: boolean; /** * Beacon endpoint. Defaults to `https://ingest.usenotra.com/api/collect`, or * to `/api/collect` on the script's origin with `endpoint` or `src`. */ api?: string; /** Load the build this SDK release pins, with its integrity hash. Defaults to true. */ pinned?: boolean; /** * Origin of a self-hosted ingest or proxy that serves the script at * `/api/notra.js`. Defaults to Notra's script host, `https://static.usenotra.com`. */ endpoint?: string; /** Full script URL, for self-hosting. Overrides `endpoint`, `errors` and `pinned`. */ src?: string; /** Subresource Integrity value, `sha384-…`. Overrides the pinned build's value. */ integrity?: string; } interface NotraScriptAttributes { src: string; integrity?: string; crossOrigin?: "anonymous"; defer: true; "data-key": string; "data-api"?: string; "data-hash"?: ""; } interface NotraScriptRelease { /** `notra.<version>.js` or `notra.plus.<version>.js`. */ file: string; /** Subresource Integrity value, `sha384-<base64>`. */ integrity: string; } interface NotraAnalyticsProps extends NotraScriptOptions { /** Render nothing, for example outside production. */ disabled?: boolean; } export type { NotraAnalyticsProps as N, NotraScriptOptions as a, NotraScriptAttributes as b, NotraScriptRelease as c };