DevRev
Get Zipy session url for a user in DevRev.
Last updated
<script>
const getCurrentZipySessionURL = async () => {
return await new Promise(function(resolve, reject) {
let i = 0;
const _interval = setInterval(() => {
let zipySessionUrl = (window)?.zipy?.getCurrentSessionURL();
if(zipySessionUrl){
resolve(zipySessionUrl);
clearInterval(_interval);
}
else{
i++;
if(i >= 4){
reject("Some problem occurred while loading zipy.");
clearInterval(_interval);
}
}
},1500);
});
}
getCurrentZipySessionURL()
.then(zipySessionUrl => {
// Call your identify API here with modified data body containing zipy session url.
/* Example data body with zipy session url */
/*
{
"rev_info": {
"user_traits": {
"email": "<end_user_email>",
"custom_fields": {
"tnt__zipy_session_url": zipySessionUrl
}
}
}
}
*/
})
.catch((e) => {
console.log(e);
});
</script>window.plugSDK.init({
app_id: '<your_unique_app_id>',
session_token: '<SESSION_TOKEN>' /* You will get this session
token in the response of identify user api.*/
});