Advanced Session Verification
Overview
Additional steps (optional)
Let's get to work
1
Retrieve the sessionId from the snippet
sessionId from the snippetModify your event handler
window.addEventListener('message', (event) => {
if (event.data?.type === 'TIUN_EVENT') {
if (event.data?.content === 'TIUN_SNIPPET_INITIALIZED') {
updateContentInfo();
} else if (event.data?.content === 'TIUN_HIDE_PAYWALL') {
// new sessionId is passed
var currentSessionId = event.data.sessionId;
// TODO: add your logic to hide the paywall
} else if (event.data?.content === 'TIUN_SHOW_PAYWALL') {
// sessionId=null is passed
var currentSessionId = event.data.sessionId;
// TODO: add your logic to show the paywall
}
}
});
// TODO: use the currentSessionId to load content from backendNext up
Last updated
Was this helpful?