Skip to content

JavaScript hooks

The Vuukle widgets expose a small JavaScript surface for SSO and for native mobile WebView integrations. There is no general-purpose DOM-event API — for behavioural changes you configure the widget from the dashboard, not by listening to events.

SSO log-in / log-out

After the widgets have loaded, you can drive authentication imperatively:

// Log a user in via SSO with a server-signed token
window.vuukleLogin(BASE64_SSO_TOKEN);
// Log the current user out
window.vuukleLogout();

Both are global functions added by platform.js. Call vuukleLogin once you’ve authenticated the visitor in your own system and minted a token (see Generate an SSO token for code samples).

Lifecycle console messages

When each widget finishes initialising, Vuukle prints a console message:

MessageFired when
Comments initialized!The comment widget has finished its first paint.
Emotes initialized!The emote widget has finished its first paint.
ShareBar initialized!The ShareBar has finished its first paint.

Inside a WebView you can intercept these via:

This is how the mobile WebView integrations know when the widget is ready to receive an SSO token via evaluateJavaScript.

SSO overview

Full token-generation flow. SSO →

iOS integration

WKWebView setup. iOS →

Was this page helpful?
Help us improve — drop a note or open the dashboard.