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.instance.user.getSessionUrl();
const sessionURLWithTimestamp = await Smartlook.instance.user.getSessionUrlWithTimestamp();

Session URL documentation.

Dashboard visitor URL

Pre API 2.0

const visitorURL = Smartlook.getDashboardVisitorUrl();

API 2.0

const userURL = await Smartlook.instance.user.getUserUrl();

User URL documentation.

Integration listeners

Pre API 2.0

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

API 2.0

// Smartlook SDK-provided type
type EventListenerCallbackShape =
  | ((url: string) => void)
  | ((url: string) => Promise<void>);

Smartlook.instance.eventListeners.registerUserChangedListener(
   eventListenerCallback?: EventListenerCallbackShape
);
  
Smartlook.instance.eventListeners.registerSessionChangedListener(
   eventListenerCallback?: EventListenerCallbackShape
);