Search


Search something to see results

SpeedKitGlobal

A global controller object containing client-side information and operations.

interface SpeedKitGlobal {
    activate: () => void;
    actualGroup: string;
    actualSplitTestId: string;
    bypassDeactivation: (active: boolean) => void;
    controllingServiceWorker: string;
    deactivate: () => void;
    disabled: boolean;
    dynamicBlocks?: DynamicBlockMetadata;
    executionTime: number;
    fetchBloomFilter: () => void;
    getHash: (input: string) => string;
    getTrackedData: () => TrackingObject;
    group: string;
    isPageTypeEnabled: (url: string) => boolean;
    lastNavigate: NavigateMetadata;
    makeScriptExecutable: (
        script: HTMLScriptElement,
        stripAttributes: boolean,
        enableCookieBotHandling: boolean,
    ) => HTMLScriptElement;
    markAsMerged: (block: HTMLElement) => void;
    navigateId: string;
    pageTypeEnabled: boolean;
    plugins: { [index: string]: RumPlugin<TrackingData> };
    preload: (urls: (string | PreloadResource)[]) => void;
    processScriptQueue?: (breakpoint?: string, recursive?: boolean) => void;
    readyState: ReadyState;
    replaceBlock: (oldBlock: HTMLElement, newBlock: HTMLElement) => void;
    rumController: IRumController;
    rumPlugins: RumPlugin<TrackingData>[];
    screenResolution: ScreenResolution;
    setAuthToken: (token: string) => void;
    simulateOfflineMode: (active: boolean) => void;
    skSupported: boolean;
    softNavigate?: SoftNavigateMetadata;
    split?: number;
    splitTestId: string;
    subscribe: () => Promise<WebPushState>;
    swSupported: boolean;
    track: (
        action: string,
        label: string,
        value: number,
        immediately?: boolean,
        withTimestamp?: boolean,
    ) => void;
    updateCookies: (event?: string) => void;
    updateDevice: (deviceType: string) => void;
    userId: string;
}

Index

Properties

Global Variables.SpeedKitGlobal.activateGlobal Variables.SpeedKitGlobal.actualGroupGlobal Variables.SpeedKitGlobal.actualSplitTestIdGlobal Variables.SpeedKitGlobal.bypassDeactivationGlobal Variables.SpeedKitGlobal.controllingServiceWorkerGlobal Variables.SpeedKitGlobal.deactivateGlobal Variables.SpeedKitGlobal.disabledGlobal Variables.SpeedKitGlobal.dynamicBlocksGlobal Variables.SpeedKitGlobal.executionTimeGlobal Variables.SpeedKitGlobal.fetchBloomFilterGlobal Variables.SpeedKitGlobal.getHashGlobal Variables.SpeedKitGlobal.getTrackedDataGlobal Variables.SpeedKitGlobal.groupGlobal Variables.SpeedKitGlobal.isPageTypeEnabledGlobal Variables.SpeedKitGlobal.lastNavigateGlobal Variables.SpeedKitGlobal.makeScriptExecutableGlobal Variables.SpeedKitGlobal.markAsMergedGlobal Variables.SpeedKitGlobal.navigateIdGlobal Variables.SpeedKitGlobal.pageTypeEnabledGlobal Variables.SpeedKitGlobal.pluginsGlobal Variables.SpeedKitGlobal.preloadGlobal Variables.SpeedKitGlobal.processScriptQueueGlobal Variables.SpeedKitGlobal.readyStateGlobal Variables.SpeedKitGlobal.replaceBlockGlobal Variables.SpeedKitGlobal.rumControllerGlobal Variables.SpeedKitGlobal.rumPluginsGlobal Variables.SpeedKitGlobal.screenResolutionGlobal Variables.SpeedKitGlobal.setAuthTokenGlobal Variables.SpeedKitGlobal.simulateOfflineModeGlobal Variables.SpeedKitGlobal.skSupportedGlobal Variables.SpeedKitGlobal.softNavigateGlobal Variables.SpeedKitGlobal.splitGlobal Variables.SpeedKitGlobal.splitTestIdGlobal Variables.SpeedKitGlobal.subscribeGlobal Variables.SpeedKitGlobal.swSupportedGlobal Variables.SpeedKitGlobal.trackGlobal Variables.SpeedKitGlobal.updateCookiesGlobal Variables.SpeedKitGlobal.updateDeviceGlobal Variables.SpeedKitGlobal.userId

Properties

activate: () => void

Locally activates Speed Kit.

2.3.0

actualGroup: string

Represents the chosen group for the A/B Test information from last navigate.

actualSplitTestId: string

The ID of the user's assigned split test from last navigate.

bypassDeactivation: (active: boolean) => void

Activates bypassing deactivation mechanism of Speed Kit.

2.3.0

controllingServiceWorker: string

The Service Worker url that was controlling the navigation.

1.20.0

deactivate: () => void

Locally deactivates Speed Kit.

2.3.0

disabled: boolean

Indicates whether Speed Kit is disabled within config.

2.4.0

dynamicBlocks?: DynamicBlockMetadata

Holds metadata about Dynamic Blocks.

1.19.0

executionTime: number

The time when the snippet got executed.

1.20.0

fetchBloomFilter: () => void

Fetches the Bloom Filter

2.7.0

getHash: (input: string) => string

Hashes an input string salted with a local salt.

2.5.0

getTrackedData: () => TrackingObject

Returns the current tracked RUM data.

2.14.0

group: string

Represents the chosen group for the A/B Test.

All users that are assigned to group "B" will not benefit from Speed Kit but serve as the control group to compare performance and business metrics against.

isPageTypeEnabled: (url: string) => boolean

Whether SpeedKit is enabled for a given page type. Currently, this method only evaluates document requests. Asset requests are not supported.

Type Declaration

    • (url: string): boolean
    • Parameters

      • url: string

      Returns boolean

      true if the page type is enabled, otherwise false.

2.18.0

lastNavigate: NavigateMetadata

Holds metadata of the user's last navigation.

Use the lastNavigate object to retrieve timings and flags about the last navigate request by the user, helping you to analyze their perceived performance.

makeScriptExecutable: (
    script: HTMLScriptElement,
    stripAttributes: boolean,
    enableCookieBotHandling: boolean,
) => HTMLScriptElement

Clones the given script which will be executed when added to the current document.

2.1.0

markAsMerged: (block: HTMLElement) => void

Marks the block as merged. Use this in case of merging without replaceBlock.

2.11.0

navigateId: string

ID of the current navigation

pageTypeEnabled: boolean

Whether SpeedKit is enabled for the current page type.

2.13.0

plugins: { [index: string]: RumPlugin<TrackingData> }

Object containing all real user monitoring (RUM) plugins embedded on the site.

1.19.0

preload: (urls: (string | PreloadResource)[]) => void

Prewarms the urls which are sent to the Service Worker And fetched against our AssetAPI but never against the origin.

2.14.0

processScriptQueue?: (breakpoint?: string, recursive?: boolean) => void

Processes the next scripts from the remote document until the breakpoint script is reached.

readyState: ReadyState

Describes the loading state of the Speed Kit global object.

syncPrepared: synchronous execution of this object's initialization is completed. complete: both synchronous and asynchronous executions of this object's initialization are completed. For example, SpeedKit.lastNavigate.applicationState value only exists after asynchronous execution.

replaceBlock: (oldBlock: HTMLElement, newBlock: HTMLElement) => void

Replaces the old block with the new block in the given DOM. In contrast to replaceChild, this function makes sure that visual elements are replaced correctly, e.g. SVGs und no-script tags.

rumController: IRumController

The controller to register real user monitoring (RUM) plugins.

1.19.0

rumPlugins: RumPlugin<TrackingData>[]

Object containing all real user monitoring (RUM) plugins embedded on the site.

2.4.0

screenResolution: ScreenResolution

Native screen resolution of the device.

2.12.0

setAuthToken: (token: string) => void

Sets authentication token query parameter from Speedkit's Global object if it is present, which in turn enforces the asset response to be from the server.

2.16.0

simulateOfflineMode: (active: boolean) => void

Simulates offline mode for the client.

2.6.0

skSupported: boolean

Indicates whether SpeedKit is supported in this browser.

2.11.0

softNavigate?: SoftNavigateMetadata

Holds metadata of the user's soft navigation.

2.18.0

split?: number

Represents the chosen split for the A/B Test on a scale from 0 to 1.

In case of 1 100% of the users would be assigned to group A and none to B. In case of 0.5 50% of the users would be assigned to group A and 50% to group B.

1.21.0

splitTestId: string

The ID of the user's assigned split test.

subscribe: () => Promise<WebPushState>

Subscribes to Web Push Notifications.

Calling this function will ask the user for permission and add a subscription for Web Push Notifications sent from the Speed Kit Service Worker.

swSupported: boolean

Indicates whether Service Workers are supported based on the browser.

2.11.0

track: (
    action: string,
    label: string,
    value: number,
    immediately?: boolean,
    withTimestamp?: boolean,
) => void

Track custom events

updateCookies: (event?: string) => void

Function to update cookies in Worker.

2.11.0

updateDevice: (deviceType: string) => void

Updates the device type set by the config or determined by SpeedKit.

userId: string

The unique ID of the user loading the page.

The ID is stored locally and kept intact for the same user. The ID may change when the user clears cookies and local storage.