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
Properties
activate
Locally activates Speed Kit.
actual Group
Represents the chosen group for the A/B Test information from last navigate.
actual Split Test Id
The ID of the user's assigned split test from last navigate.
bypass Deactivation
Activates bypassing deactivation mechanism of Speed Kit.
controlling Service Worker
The Service Worker url that was controlling the navigation.
deactivate
Locally deactivates Speed Kit.
disabled
Indicates whether Speed Kit is disabled within config.
Optional
dynamic Blocks
Holds metadata about Dynamic Blocks.
execution Time
The time when the snippet got executed.
fetch Bloom Filter
Fetches the Bloom Filter
get Hash
Hashes an input string salted with a local salt.
get Tracked Data
Returns the current tracked RUM data.
group
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.
is Page Type Enabled
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, otherwisefalse
.
last Navigate
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.
make Script Executable
script: HTMLScriptElement,
stripAttributes: boolean,
enableCookieBotHandling: boolean,
) => HTMLScriptElement
Clones the given script which will be executed when added to the current document.
mark As Merged
Marks the block as merged. Use this in case of merging without replaceBlock.
navigate Id
ID of the current navigation
page Type Enabled
Whether SpeedKit is enabled for the current page type.
plugins
Object containing all real user monitoring (RUM) plugins embedded on the site.
preload
Prewarms the urls which are sent to the Service Worker And fetched against our AssetAPI but never against the origin.
Optional
process Script Queue
Processes the next scripts from the remote document until the breakpoint script is reached.
ready State
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.
replace Block
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.
rum Controller
The controller to register real user monitoring (RUM) plugins.
rum Plugins
Object containing all real user monitoring (RUM) plugins embedded on the site.
screen Resolution
Native screen resolution of the device.
set Auth Token
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.
simulate Offline Mode
Simulates offline mode for the client.
sk Supported
Indicates whether SpeedKit is supported in this browser.
Optional
soft Navigate
Holds metadata of the user's soft navigation.
Optional
split
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.
split Test Id
The ID of the user's assigned split test.
subscribe
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.
sw Supported
Indicates whether Service Workers are supported based on the browser.
track
action: string,
label: string,
value: number,
immediately?: boolean,
withTimestamp?: boolean,
) => void
Track custom events
update Cookies
Function to update cookies in Worker.
update Device
Updates the device type set by the config or determined by SpeedKit.
user Id
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.
A global controller object containing client-side information and operations.