@genex-ai/embed-sdk 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-EEOKYBXG.js → chunk-XGTGIWVQ.js} +19 -1
- package/dist/index.js +1 -1
- package/dist/sentry.js +10 -10
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
var PROTOCOL_VERSION = 1;
|
|
3
3
|
var RETRY_FLAG = "genex:embed:retry";
|
|
4
4
|
var POPOVER_DISMISSED_FLAG = "genex:guest:popover-dismissed";
|
|
5
|
+
var PLAYER_ID_KEY = "genex:player";
|
|
5
6
|
var config = null;
|
|
6
7
|
var state = "pending";
|
|
7
8
|
var user = null;
|
|
@@ -70,6 +71,20 @@ function writePopoverDismissed() {
|
|
|
70
71
|
} catch {
|
|
71
72
|
}
|
|
72
73
|
}
|
|
74
|
+
function playerId() {
|
|
75
|
+
try {
|
|
76
|
+
const store = win()?.localStorage;
|
|
77
|
+
if (!store) return "no-storage";
|
|
78
|
+
let id = store.getItem(PLAYER_ID_KEY);
|
|
79
|
+
if (!id) {
|
|
80
|
+
id = typeof crypto !== "undefined" && typeof crypto.randomUUID === "function" ? crypto.randomUUID() : `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
|
|
81
|
+
store.setItem(PLAYER_ID_KEY, id);
|
|
82
|
+
}
|
|
83
|
+
return id;
|
|
84
|
+
} catch {
|
|
85
|
+
return "no-storage";
|
|
86
|
+
}
|
|
87
|
+
}
|
|
73
88
|
function initEmbed(cfg) {
|
|
74
89
|
const w = win();
|
|
75
90
|
if (!w) return;
|
|
@@ -471,7 +486,10 @@ async function requestGuestSession() {
|
|
|
471
486
|
const res = await doFetch(`${config.apiUrl}/api/embed/guest-session`, {
|
|
472
487
|
method: "POST",
|
|
473
488
|
headers: { "Content-Type": "application/json" },
|
|
474
|
-
|
|
489
|
+
// playerId is analytics-only: the SERVER still mints the session's own
|
|
490
|
+
// guest id and the token is unchanged — this just lets the play event
|
|
491
|
+
// key on something that survives the tab.
|
|
492
|
+
body: JSON.stringify({ slug: config.slug, playerId: playerId() })
|
|
475
493
|
});
|
|
476
494
|
if (epoch !== identityEpoch) return;
|
|
477
495
|
if (!res.ok) {
|
package/dist/index.js
CHANGED
package/dist/sentry.js
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
_stashTicketFromUrl,
|
|
3
3
|
getUser,
|
|
4
4
|
on
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-XGTGIWVQ.js";
|
|
6
6
|
|
|
7
7
|
// src/sentry.ts
|
|
8
8
|
import * as Sentry from "@sentry/browser";
|
|
@@ -41,15 +41,15 @@ function initGameSentry(opts) {
|
|
|
41
41
|
Sentry.init({
|
|
42
42
|
dsn: opts.dsn ?? DEFAULT_GAMES_DSN,
|
|
43
43
|
environment: opts.environment ?? "production",
|
|
44
|
-
//
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
//
|
|
48
|
-
//
|
|
49
|
-
//
|
|
50
|
-
tracesSampleRate: touchSession ? 0.
|
|
51
|
-
replaysSessionSampleRate:
|
|
52
|
-
replaysOnErrorSampleRate:
|
|
44
|
+
// Rates are sized to the org quota, which every project shares: 5M spans and
|
|
45
|
+
// 50 replays per month. The previous desktop 1.0/1.0 exhausted both in July
|
|
46
|
+
// 2026, after which Sentry drops everything. Touch stays lower than desktop
|
|
47
|
+
// for the 2026-07-21 mobile-readiness reason (replay + canvas readback burns
|
|
48
|
+
// phone memory), and session replay is off outright — 50/month only stretches
|
|
49
|
+
// to errored sessions.
|
|
50
|
+
tracesSampleRate: touchSession ? 0.05 : 0.1,
|
|
51
|
+
replaysSessionSampleRate: 0,
|
|
52
|
+
replaysOnErrorSampleRate: 0.01,
|
|
53
53
|
dataCollection: { userInfo: true },
|
|
54
54
|
initialScope: { tags: { game_slug: opts.slug } },
|
|
55
55
|
integrations: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genex-ai/embed-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Player identity + durable game state for genex games \u2014 signed-in or guest play, per-player save slots, shared world state, and soft-trust leaderboards.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|