@blotoutio/edgetag-sdk-js
Advanced tools
Comparing version 0.60.0 to 0.60.1
@@ -280,2 +280,3 @@ 'use strict'; | ||
const cookieKey = 'tag_user_id'; | ||
const fallbackSessionKey = 'fallback_tag_user_id'; | ||
@@ -552,3 +553,3 @@ const getMessage = (error) => { | ||
locale: getLocale(), | ||
sdkVersion: "0.60.0" , | ||
sdkVersion: "0.60.1" , | ||
...(payload || {}), | ||
@@ -1101,2 +1102,22 @@ }; | ||
} | ||
let fallbackId; | ||
try { | ||
fallbackId = preferences.fallbackUserId; | ||
if (!fallbackId) { | ||
const fallbackSessionValue = sessionStorage.getItem(fallbackSessionKey); | ||
if (!fallbackSessionValue) { | ||
const randomId = crypto.randomUUID(); | ||
if (randomId) { | ||
fallbackId = `${randomId}-${Date.now()}`; | ||
sessionStorage.setItem(fallbackSessionKey, fallbackId); | ||
} | ||
} | ||
else { | ||
fallbackId = fallbackSessionValue; | ||
} | ||
} | ||
} | ||
catch { | ||
// do nothing | ||
} | ||
if (preferences.afterManifestEvents) { | ||
@@ -1116,2 +1137,5 @@ setSetting(preferences.edgeURL, { | ||
} | ||
if (fallbackId) { | ||
url.searchParams.set('fallbackUserId', fallbackId); | ||
} | ||
getRequest(url.href) | ||
@@ -1118,0 +1142,0 @@ .then((result) => { |
@@ -45,2 +45,3 @@ import { ProvidersConfig } from '@blotoutio/cdn/types' | ||
userId?: string | ||
fallbackUserId?: string | ||
providers?: ProviderInit[] | ||
@@ -47,0 +48,0 @@ afterManifestEvents?: Stub[] |
{ | ||
"name": "@blotoutio/edgetag-sdk-js", | ||
"version": "0.60.0", | ||
"version": "0.60.1", | ||
"description": "JS SDK for EdgeTag", | ||
@@ -5,0 +5,0 @@ "author": "Blotout", |
Sorry, the diff of this file is not supported yet
90385
2783