import { optionsInterface, DEFAULT_COLLECT_ENDPOINT } from '../options'; import type { collectDirective } from '../functions/api'; /** * Destination for the one-shot beacon that pairs a browser's User-Agent with * its computed thumbmark, sent only when the pro API's response instructs * the client to send one (see apiResponse.collect). The collector observes the TLS * handshake of this same connection server-side, so this must be a direct * browser-to-host request -- no proxy, no CDN in front of it. * * Defined in `../options` (same precedent as `DEFAULT_API_ENDPOINT`) and * re-exported here so this module's own consumers/tests don't need a second * import. * @internal */ export { DEFAULT_COLLECT_ENDPOINT }; /** * Sends the one-shot collect beacon when the caller (index.ts) has already * determined the pro API asked the client to send one (apiResult.collect is * present as a directive object). `directive` carries whatever the server * observed for this request that it wants echoed back -- today that is the * `ja4`/`source` fields, but the caller and this function stay agnostic * about what's being collected; they only act on "a directive object is * present, so send a beacon". `directive.source` is named to match the API * *response* field (`collect.source`); the beacon *body* sent to the * collector uses the wire field `ja4_source` instead -- see the mapping * below. This naming difference is intentional, not a bug. Never throws, * never rejects, is never * awaited by its caller, never affects the returned fingerprint, and * carries no sampling/targeting logic of its own -- that lives entirely * server-side. As a best-effort default, at most one attempt per browser * session (see hasAttemptedThisSession / markAttemptedThisSession), which * also covers the case where a cached API response keeps re-reporting a * collect directive across repeated getThumbmark() calls within the same * session. This guard is not an enforced cap: it relies on sessionStorage, * which fails open when blocked and can be * cleared by the page. * @internal */ export declare function sendCollectBeacon(thumbmark: string, options: optionsInterface, directive?: collectDirective): void;