interface ISenderConfig {
    alwaysUseXhrOverride?: boolean;
    bufferOverride: false | IStorageBuffer;
    convertUndefined: any;
    corsPolicy?: string;
    customHeaders: [{
        header: string;
        value: string;
    }];
    disableSendBeaconSplit?: boolean;
    disableTelemetry: boolean;
    disableXhr: boolean;
    emitLineDelimitedJson: boolean;
    enableSendPromise?: boolean;
    enableSessionStorageBuffer: boolean;
    endpointUrl: string;
    eventsLimitInMem: number;
    httpXHROverride?: IXHROverride;
    instrumentationKey: string;
    isBeaconApiDisabled: boolean;
    isRetryDisabled: boolean;
    maxBatchInterval: number;
    maxBatchSizeInBytes: number;
    maxRetryCnt?: number;
    namePrefix: string;
    onunloadDisableBeacon: boolean;
    onunloadDisableFetch: boolean;
    retryCodes?: number[];
    samplingPercentage: number;
    transports?: number | number[];
    unloadTransports?: number | number[];
}

Properties

alwaysUseXhrOverride?: boolean

[Optional] By default during unload (or when you specify to use sendBeacon() or sync fetch (with keep-alive) for an event) the SDK ignores any provided httpXhrOverride and attempts to use sendBeacon() or fetch(with keep-alive) when they are available. When this configuration option is true any provided httpXhrOverride will always be used, so any provided httpXhrOverride will also need to "handle" the synchronous unload scenario.

3.0.4

bufferOverride: false | IStorageBuffer

Specify the storage buffer type implementation.

2.8.12

convertUndefined: any

(Optional) Provide user an option to convert undefined field to user defined value.

corsPolicy?: string

[Optional] Specifies the Cross-Origin Resource Policy (CORP) for the endpoint. This value is included in the response header as Cross-Origin-Resource-Policy, which helps control how resources can be shared across different origins.

Possible values:

  • same-site: Allows access only from the same site.
  • same-origin: Allows access only from the same origin (protocol, host, and port).
  • cross-origin: Allows access from any origin.

3.3.7

customHeaders: [{
    header: string;
    value: string;
}]

(Optional) The ability for the user to provide extra headers

disableSendBeaconSplit?: boolean

[Optional] Disable events splitting during sendbeacon. Default: false

3.0.6

disableTelemetry: boolean

The master off switch. Do not send any data if set to TRUE

disableXhr: boolean

Don't use XMLHttpRequest or XDomainRequest (for IE < 9) by default instead attempt to use fetch() or sendBeacon. If no other transport is available it will still use XMLHttpRequest

emitLineDelimitedJson: boolean

The JSON format (normal vs line delimited). True means line delimited JSON.

enableSendPromise?: boolean

(Optional) Enable the sender to return a promise so that manually flushing (and general sending) can wait for the request to finish. Note: Enabling this may cause unhandled promise rejection errors to occur if you do not listen and handle any rejection response, this should only be for manual flush attempts. Defaults to false

3.0.1

enableSessionStorageBuffer: boolean

Store a copy of a send buffer in the session storage

endpointUrl: string

The url to which payloads will be sent

eventsLimitInMem: number

(Optional) The number of events that can be kept in memory before the SDK starts to drop events. By default, this is 10,000.

httpXHROverride?: IXHROverride

[Optional] The HTTP override that should be used to send requests, as an IXHROverride object. By default during the unload of a page or if the event specifies that it wants to use sendBeacon() or sync fetch (with keep-alive), this override will NOT be called. If alwaysUseXhrOverride configuration value is set to true, the override will always be used. The payload data (first argument) now also includes any configured 'timeout' (defaults to undefined) and whether you should avoid creating any synchronous XHR requests 'disableXhr' (defaults to false/undefined)

3.0.4

instrumentationKey: string

(Optional) Override the instrumentation key that this channel instance sends to

isBeaconApiDisabled: boolean
isRetryDisabled: boolean

Is retry handler disabled. If enabled, retry on 206 (partial success), 408 (timeout), 429 (too many requests), 500 (internal server error) and 503 (service unavailable).

maxBatchInterval: number

The maximum interval allowed between calls to batchInvoke

maxBatchSizeInBytes: number

The maximum size of a batch in bytes

maxRetryCnt?: number

(Optional) The specific max retry count for each telemetry item. Default: 10 if it is set to 0, means no retry allowed if it is set to undefined, means no limit for retry times

3.2.0

namePrefix: string
onunloadDisableBeacon: boolean

Is beacon disabled on page unload. If enabled, flush events through beaconSender.

onunloadDisableFetch: boolean

If fetch keepalive is supported do not use it for sending events during unload, it may still fallback to fetch() without keepalive

retryCodes?: number[]

(Optional) The specific error codes that will cause a retry of sending data to the backend.

3.1.1

samplingPercentage: number
transports?: number | number[]

[Optional] Either an array or single value identifying the requested TransportType type that should be used. This is used during initialization to identify the requested send transport, it will be ignored if a httpXHROverride is provided.

unloadTransports?: number | number[]

[Optional] Either an array or single value identifying the requested TransportType type(s) that should be used during unload or events marked as sendBeacon. This is used during initialization to identify the requested send transport, it will be ignored if a httpXHROverride is provided and alwaysUseXhrOverride is true.