Utilities

Dashboard session URL

Pre API 2.0

const sessionURL = Smartlook.getDashboardSessionUrl(false);
const sessionURLWithTimestamp = Smartlook.getDashboardSessionUrl(true);

API 2.0

const sessionUrl = await Smartlook.getSessionUrl();
const sessionUrlWithTimestamp = await Smartlook.getSessionUrlWithTimestamp();

Session URL documentation.

Dashboard visitor URL

Pre API 2.0

const visitorURL = Smartlook.getDashboardVisitorUrl();

API 2.0

const userUrl = await Smartlook.getUserUrl();

User URL documentation.

Integration listeners

Pre API 2.0

Smartlook.registerIntegrationListener(
		dashboardSessionUrlCallback: (url: string) => void,
		dashboardVisitorUrlCallback: (url: string) => void,
	);

API 2.0

// A callback function that gets called when the user URL changes.
function urlChangedCallback(url: string) {
  console.log('Emitted url', url);
}

Smartlook.registerUserUrlChangedListener({
  userUrlChangedCallback: urlChangedCallback
});
  
Smartlook.registerSessionUrlChangedListener({
  sessionUrlChangedCallback: urlChangedCallback
});