@genex-ai/embed-sdk 0.3.1 → 0.3.2

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.
@@ -204,10 +204,21 @@ function _stashTicketFromUrl() {
204
204
  if (!hash || !hash.includes("genex_")) return;
205
205
  stashedTicketHash = hash;
206
206
  try {
207
- w.history.replaceState(null, "", w.location.pathname + w.location.search);
207
+ w.history.replaceState(null, "", cleanUrl(w));
208
208
  } catch {
209
209
  }
210
210
  }
211
+ function cleanUrl(w) {
212
+ let search = w.location.search;
213
+ try {
214
+ const params = new URLSearchParams(search);
215
+ params.delete("genex_r");
216
+ const rest = params.toString();
217
+ search = rest ? `?${rest}` : "";
218
+ } catch {
219
+ }
220
+ return w.location.pathname + search;
221
+ }
211
222
  function readFragment(w) {
212
223
  const hash = stashedTicketHash ?? w.location.hash;
213
224
  stashedTicketHash = null;
@@ -223,7 +234,7 @@ function readFragment(w) {
223
234
  }
224
235
  if (ticket || guest) {
225
236
  try {
226
- w.history.replaceState(null, "", w.location.pathname + w.location.search);
237
+ w.history.replaceState(null, "", cleanUrl(w));
227
238
  } catch {
228
239
  }
229
240
  }
@@ -231,8 +242,7 @@ function readFragment(w) {
231
242
  }
232
243
  async function redirectToAuthorize(w, opts) {
233
244
  if (!config) return;
234
- const origins = await fetchDashboardOrigins();
235
- const origin = origins[0] ?? config.dashboardOrigins[0];
245
+ const origin = opts?.guestOk ? config.dashboardOrigins[0] ?? (await fetchDashboardOrigins())[0] : (await fetchDashboardOrigins())[0] ?? config.dashboardOrigins[0];
236
246
  if (!origin) {
237
247
  enterBlocked();
238
248
  return;
@@ -437,7 +447,7 @@ function removeOverlay() {
437
447
  function buildOverlay(d) {
438
448
  const root = d.createElement("div");
439
449
  root.setAttribute("data-genex-embed-overlay", "");
440
- root.style.cssText = "position:fixed;inset:0;z-index:2147483647;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:16px;background:rgba(8,10,20,0.92);color:#fff;font-family:system-ui,-apple-system,sans-serif;text-align:center;pointer-events:auto;user-select:none";
450
+ root.style.cssText = "position:fixed;inset:0;z-index:2147483647;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:16px;background:#080a14;color:#fff;font-family:system-ui,-apple-system,sans-serif;text-align:center;pointer-events:auto;user-select:none";
441
451
  const title = d.createElement("div");
442
452
  title.style.cssText = "font-size:18px;font-weight:600;padding:0 24px";
443
453
  root.appendChild(title);
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  on,
11
11
  waitForAuth,
12
12
  waitForPlayer
13
- } from "./chunk-S7JLPCNE.js";
13
+ } from "./chunk-A2RFRR7H.js";
14
14
  export {
15
15
  __resetForTests,
16
16
  _stashTicketFromUrl,
package/dist/sentry.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  _stashTicketFromUrl,
3
3
  getUser,
4
4
  on
5
- } from "./chunk-S7JLPCNE.js";
5
+ } from "./chunk-A2RFRR7H.js";
6
6
 
7
7
  // src/sentry.ts
8
8
  import * as Sentry from "@sentry/browser";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@genex-ai/embed-sdk",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Player identity for genex games — signed-in (dashboard iframe postMessage handshake or sign-in redirect) or guest (accountless play for published games, sign in to save).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",