Skip to main content

Tracker API reference

Definition​

This document provides a detailed walkthrough of the tracker API methods and properties

queueEmpty$​

This property type is Subject<boolean> and it will emit to its observers true each time the queue becomes empty

Usage in wrappers​


import { initializeScoped } from '@pulse/browser';


const pulse = initializeScoped({
app: 'your application name'
});


// Now you can subscribe to queueEmpty$ from pulse object
pulse.queueEmpty$.subscribe();

getState​

This is a function that returns a Promise<Record<string, unknown>> which represents the Pulse SDK state.


import { initializeScoped } from '@pulse/browser';

const pulse = initializeScoped({
app: 'your application name'
});
const pulseState = await pulse.getState();

clearNavigationSource​

This is a function that takes an optional label and returns nothing. It cancels the tab's pending declared navigation: the next navigation is no longer attributed to the click on a pulse-navigate element. With a label, it cancels only a declaration with that label. See Declared Navigation Source.


import { initializeScoped } from '@pulse/browser';

const pulse = initializeScoped({
app: 'your application name'
});
pulse.clearNavigationSource('checkout cta');

Once the SDK is loaded, the call takes effect at once. On the server SDK it does nothing.