@looplay/sdk 0.8.7 → 0.8.9

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.
@@ -17,12 +17,12 @@ export interface LooplayIframeAuthOptions {
17
17
  */
18
18
  appId?: string;
19
19
  /**
20
- * Backend API base URL. Required to track outside the Looplay iframe;
21
- * when embedded and omitted, falls back to whatever `apiUrl` the parent
22
- * pushes.
20
+ * Backend API base URL. Defaults to `import.meta.env.VITE_API_URL` or
21
+ * `'https://api.looplay.gg'`. When embedded and omitted, falls back to
22
+ * whatever `apiUrl` the parent pushes.
23
23
  */
24
24
  apiUrl?: string;
25
- /** Restrict accepted postMessage origin. Defaults to `document.referrer`'s origin. */
25
+ /** Restrict accepted postMessage origin. Defaults to `import.meta.env.VITE_PARENT_ORIGIN` or `document.referrer`'s origin. */
26
26
  parentOrigin?: string;
27
27
  /** Opt-in tracing hook; called for every internal step (auth received, tracking calls, ...). */
28
28
  onDebug?: (message: string, details?: Record<string, unknown>) => void;
@@ -5,4 +5,5 @@ export * from './auth';
5
5
  export * from './apps';
6
6
  export * from './iframe';
7
7
  export * from './version';
8
+ export * from './constants';
8
9
  export type { GameEventKey } from '@looplay/types';
@@ -39,5 +39,12 @@ export declare class LooplaySDK {
39
39
  }): Promise<EmitGameEventResponse>;
40
40
  private assertInitialized;
41
41
  private verifyGameId;
42
+ /**
43
+ * Best-effort self-report — must never block init(). A missing/misconfigured
44
+ * whitelist (a separate setup step from SDK integration) makes the backend
45
+ * reject this call; if that rejection propagated, the whole init() would
46
+ * reject too and every other SDK method would throw NotInitializedError,
47
+ * breaking a game over what's really just an unfinished onboarding step.
48
+ */
42
49
  private detectIntegration;
43
50
  }
@@ -2,6 +2,7 @@ import type { LooplayAuthOptions } from './auth/types';
2
2
  import type { FetchLike } from './apps/http';
3
3
  export interface LooplaySDKCreateOptions {
4
4
  auth?: LooplayAuthOptions;
5
+ /** Backend API base URL. Defaults to `import.meta.env.VITE_API_URL` or `'https://api.looplay.gg'`. */
5
6
  baseUrl?: string;
6
7
  fetch?: FetchLike;
7
8
  defaultHeaders?: Record<string, string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@looplay/sdk",
3
- "version": "0.8.7",
3
+ "version": "0.8.9",
4
4
  "description": "LooplaySDK (auth + points) for game integrations",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",