RequestWithOptions

Properties

NameType
callback(response: RequestResponse) => void
compressionCompression | 'best-available'
compressionFallbackCompression

Used when best-available compression negotiation does not select a format.

dataRecord<string, any> | Record<string, any>[]
disableTransport('XHR' | 'fetch' | 'sendBeacon')[]
fetchOptions{ cache?: RequestInit['cache']; next?: NextOptions; }
fireCallbackOnDropboolean

When set, _send_request invokes callback with a synthetic response on the paths that otherwise drop a request without notifying the caller (client not loaded, server rate limit). Opt-in so existing callers keep their current behavior; the logs pipeline uses it to keep records for a later retry instead of losing them silently.

headersRecord<string, any>
method'POST' | 'GET'
noRetriesboolean
onDispatch() => void

Called each time _send_request hands the request to the transport. It is not called on the paths that drop the request before the network.

preferSyncCompressionboolean

Bypasses asynchronous CompressionStream gzip in favor of synchronous compression. Used for immediate requests so compression does not delay dispatch until after a navigation or page unload.

timeoutnumber
timestampMode'body' | 'capture-body' | 'query'

Controls where the request dispatch time is sent. - body adds ISO sent_at to the request object, or every object in an array (for example, flags and recordings). - capture-body wraps events in { api_key, batch, sent_at } with an ISO timestamp. - query adds numeric sent_at to POST requests or cache-busting _ to GET requests.

transport'XHR' | 'fetch' | 'sendBeacon'
urlstring
urlQueryArgs{ compression: Compression; }