import type { VTiltConfig } from "../types"; /** Header that carries the project token on every authenticated SDK call. * Matches the server-side `withPublicProjectAccess` wrapper, which reads * the same name (`request.headers.get('x-api-key')`) before falling back * to the `?token=` query parameter. */ export declare const PROJECT_TOKEN_HEADER = "x-api-key"; export interface BuildEndpointUrlOptions { /** * Append `?token=` to the URL. Off by default so the URL stays * clean — privacy/ad blockers commonly match on `?token=` in known * analytics origins, and the cleaner the URL is the less likely a * legitimate request gets cancelled with `ERR_BLOCKED_BY_CLIENT`. * * Pass `true` only for transports that cannot carry a custom header * (i.e. `navigator.sendBeacon`), where the query parameter is still * the only practical way to authenticate the request. */ includeTokenQuery?: boolean; } /** * Resolves a path + project token to a full request URL. * Used by the main client and by lazy chunks (e.g. session recording) that * only have access to `getConfig()` and must not depend on `VTilt` prototype methods. * * By default the returned URL does NOT carry the project token. Callers * are expected to attach it via the `x-api-key` header (see * `getProjectTokenHeader`). For `sendBeacon` paths where headers aren't * supported, pass `{ includeTokenQuery: true }`. */ export declare function buildEndpointUrlFromConfig(config: Pick, path: string, options?: BuildEndpointUrlOptions): string; /** * Returns the auth header dict to merge into a `fetch` / `XMLHttpRequest` * call. Returns an empty object when no token is configured so callers * can spread it unconditionally. */ export declare function getProjectTokenHeader(config: Pick): Record;