@looplay/sdk 0.8.8 → 0.8.10

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.
@@ -37,7 +37,7 @@ export declare class LooplayIframeAuth {
37
37
  constructor(options?: LooplayIframeAuthOptions);
38
38
  getState(): LooplayIframeAuthState;
39
39
  getJwt(): string | null;
40
- getApiUrl(): string | null;
40
+ getApiUrl(): string;
41
41
  /** Resolves to the configured `appId`, falling back to whatever the parent pushed as `gameId`. */
42
42
  getGameId(): string | null;
43
43
  getAnonymousId(): string | null;
@@ -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';
@@ -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>;
@@ -1 +1 @@
1
- export declare const LOOPLAY_SDK_VERSION = "0.8.5";
1
+ export declare const LOOPLAY_SDK_VERSION = "0.8.10";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@looplay/sdk",
3
- "version": "0.8.8",
3
+ "version": "0.8.10",
4
4
  "description": "LooplaySDK (auth + points) for game integrations",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",