@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.
- package/README.md +10 -9
- package/dist/looplay-sdk.cjs.js +72 -14
- package/dist/looplay-sdk.cjs.js.map +1 -1
- package/dist/looplay-sdk.esm.js +69 -15
- package/dist/looplay-sdk.esm.js.map +1 -1
- package/dist/looplay-sdk.min.js +5 -5
- package/dist/looplay-sdk.min.js.map +1 -1
- package/dist/types/constants.d.ts +20 -0
- package/dist/types/iframe/iframe-auth.d.ts +7 -6
- package/dist/types/iframe/types.d.ts +4 -4
- package/dist/types/index.d.ts +1 -0
- package/dist/types/looplay-sdk.d.ts +7 -0
- package/dist/types/types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -17,12 +17,12 @@ export interface LooplayIframeAuthOptions {
|
|
|
17
17
|
*/
|
|
18
18
|
appId?: string;
|
|
19
19
|
/**
|
|
20
|
-
* Backend API base URL.
|
|
21
|
-
*
|
|
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;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -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
|
}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -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>;
|