@smartico/public-api 0.0.399 → 0.0.401

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.
Files changed (53) hide show
  1. package/dist/Core/index.d.ts +1 -0
  2. package/dist/GamePick/GamePickTypes.d.ts +8 -8
  3. package/dist/Level/Level.d.ts +1 -0
  4. package/dist/SmarticoGlobal.d.ts +190 -0
  5. package/dist/WSAPI/WSAPIGamePick.d.ts +6 -6
  6. package/dist/WSAPI/WSAPIMiniGames.d.ts +60 -52
  7. package/dist/WSAPI/WSAPITypes.d.ts +5 -0
  8. package/dist/index.d.ts +1 -0
  9. package/dist/index.js +78 -66
  10. package/dist/index.js.map +1 -1
  11. package/dist/index.modern.mjs +69 -60
  12. package/dist/index.modern.mjs.map +1 -1
  13. package/docs/api/README.md +20 -0
  14. package/docs/api/classes/WSAPIAvatars.md +1 -8
  15. package/docs/api/classes/WSAPIGamePick.md +48 -48
  16. package/docs/api/classes/WSAPIMiniGames.md +132 -70
  17. package/docs/api/enumerations/GPRoundStatus.md +43 -0
  18. package/docs/api/enumerations/GamePickMarketType.md +19 -0
  19. package/docs/api/enumerations/GamePickResolutionType.md +35 -0
  20. package/docs/api/enumerations/GamePickScoreType.md +19 -0
  21. package/docs/api/enumerations/GamePickSportType.md +375 -0
  22. package/docs/api/enumerations/GameRoundOrderType.md +35 -0
  23. package/docs/api/enumerations/LiquidEntityData.md +6 -0
  24. package/docs/api/interfaces/GamePickBoardUser.md +75 -0
  25. package/docs/api/interfaces/GamePickEvent.md +123 -0
  26. package/docs/api/interfaces/GamePickEventMeta.md +201 -0
  27. package/docs/api/interfaces/GamePickGameInfo.md +27 -0
  28. package/docs/api/interfaces/GamePickRequestParams.md +39 -0
  29. package/docs/api/interfaces/GamePickRound.md +383 -0
  30. package/docs/api/interfaces/GamePickRoundBase.md +232 -0
  31. package/docs/api/interfaces/GamePickRoundBoard.md +359 -0
  32. package/docs/api/interfaces/GamePickRoundPublicMeta.md +103 -0
  33. package/docs/api/interfaces/GamePickRoundRequestParams.md +63 -0
  34. package/docs/api/interfaces/GamePickUserInfo.md +107 -0
  35. package/docs/api/interfaces/GamesApiResponse.md +33 -0
  36. package/docs/api/interfaces/Level.md +8 -0
  37. package/docs/api/interfaces/QuizEventMeta.md +61 -0
  38. package/docs/api/interfaces/RafflePrizePublicMeta.md +9 -0
  39. package/docs/api/interfaces/TMiniGamePlayResult.md +11 -0
  40. package/docs/api/interfaces/TRafflePrize.md +9 -0
  41. package/docs/api/variables/AllRoundsGameBoardID.md +5 -0
  42. package/docs/ui/minigames/UIGuide_playMiniGame.md +6 -5
  43. package/package.json +1 -1
  44. package/src/Core/index.ts +1 -0
  45. package/src/GamePick/GamePickTypes.ts +8 -8
  46. package/src/Level/Level.ts +1 -0
  47. package/src/SmarticoAPI.ts +2 -1
  48. package/src/SmarticoGlobal.ts +209 -0
  49. package/src/WSAPI/WSAPIGamePick.ts +6 -6
  50. package/src/WSAPI/WSAPIMiniGames.ts +61 -52
  51. package/src/WSAPI/WSAPITypes.ts +5 -0
  52. package/src/index.ts +1 -0
  53. package/tsconfig.json +1 -0
@@ -0,0 +1,63 @@
1
+ # Interface: GamePickRoundRequestParams
2
+
3
+ GamePickRoundRequestParams extends base params with a specific round ID
4
+
5
+ ## Extends
6
+
7
+ - [`GamePickRequestParams`](GamePickRequestParams.md)
8
+
9
+ ## Properties
10
+
11
+ ### saw\_template\_id
12
+
13
+ > **saw\_template\_id**: `number`
14
+
15
+ ID of the MatchX or Quiz game template. The only field the consumer supplies.
16
+
17
+ #### Inherited from
18
+
19
+ [`GamePickRequestParams`](GamePickRequestParams.md).[`saw_template_id`](GamePickRequestParams.md#saw_template_id)
20
+
21
+ ***
22
+
23
+ ### ext\_user\_id?
24
+
25
+ > `optional` **ext\_user\_id?**: `string`
26
+
27
+ External user ID. Injected by the SDK from the active session; consumers omit it.
28
+
29
+ #### Inherited from
30
+
31
+ [`GamePickRequestParams`](GamePickRequestParams.md).[`ext_user_id`](GamePickRequestParams.md#ext_user_id)
32
+
33
+ ***
34
+
35
+ ### smartico\_ext\_user\_id?
36
+
37
+ > `optional` **smartico\_ext\_user\_id?**: `string`
38
+
39
+ Platform external user ID. Injected by the SDK from the active session; consumers omit it.
40
+
41
+ #### Inherited from
42
+
43
+ [`GamePickRequestParams`](GamePickRequestParams.md).[`smartico_ext_user_id`](GamePickRequestParams.md#smartico_ext_user_id)
44
+
45
+ ***
46
+
47
+ ### lang?
48
+
49
+ > `optional` **lang?**: `string`
50
+
51
+ Language code for translations (e.g. 'EN', 'DE'). Defaults to the session language.
52
+
53
+ #### Inherited from
54
+
55
+ [`GamePickRequestParams`](GamePickRequestParams.md).[`lang`](GamePickRequestParams.md#lang)
56
+
57
+ ***
58
+
59
+ ### round\_id
60
+
61
+ > **round\_id**: `number`
62
+
63
+ ID of the specific round
@@ -0,0 +1,107 @@
1
+ # Interface: GamePickUserInfo
2
+
3
+ GamePickUserInfo describes the current user's profile in the games system
4
+
5
+ ## Properties
6
+
7
+ ### ext\_user\_id
8
+
9
+ > **ext\_user\_id**: `string`
10
+
11
+ External user ID (Smartico numeric user ID)
12
+
13
+ ***
14
+
15
+ ### int\_user\_id
16
+
17
+ > **int\_user\_id**: `number`
18
+
19
+ Internal user ID within the games system
20
+
21
+ ***
22
+
23
+ ### public\_username
24
+
25
+ > **public\_username**: `string`
26
+
27
+ Display name
28
+
29
+ ***
30
+
31
+ ### avatar\_url
32
+
33
+ > **avatar\_url**: `string`
34
+
35
+ URL of the user's avatar image
36
+
37
+ ***
38
+
39
+ ### gp\_position?
40
+
41
+ > `optional` **gp\_position?**: `number`
42
+
43
+ User's leaderboard rank position
44
+
45
+ ***
46
+
47
+ ### full\_wins\_count?
48
+
49
+ > `optional` **full\_wins\_count?**: `number`
50
+
51
+ Number of fully correct predictions
52
+
53
+ ***
54
+
55
+ ### part\_wins\_count?
56
+
57
+ > `optional` **part\_wins\_count?**: `number`
58
+
59
+ Number of partially correct predictions
60
+
61
+ ***
62
+
63
+ ### resolution\_score?
64
+
65
+ > `optional` **resolution\_score?**: `number`
66
+
67
+ User's total score
68
+
69
+ ***
70
+
71
+ ### last\_wallet\_sync\_time?
72
+
73
+ > `optional` **last\_wallet\_sync\_time?**: `Date`
74
+
75
+ Last time the user's balance was synced from the Smartico platform
76
+
77
+ ***
78
+
79
+ ### ach\_points\_balance?
80
+
81
+ > `optional` **ach\_points\_balance?**: `number`
82
+
83
+ User's current points balance
84
+
85
+ ***
86
+
87
+ ### ach\_gems\_balance?
88
+
89
+ > `optional` **ach\_gems\_balance?**: `number`
90
+
91
+ User's current gems balance
92
+
93
+ ***
94
+
95
+ ### ach\_diamonds\_balance?
96
+
97
+ > `optional` **ach\_diamonds\_balance?**: `number`
98
+
99
+ User's current diamonds balance
100
+
101
+ ***
102
+
103
+ ### pubic\_username\_set?
104
+
105
+ > `optional` **pubic\_username\_set?**: `boolean`
106
+
107
+ Whether the user has set a custom public username
@@ -0,0 +1,33 @@
1
+ # Interface: GamesApiResponse\<T\>
2
+
3
+ GamesApiResponse is the standard response wrapper for all GamePick/Quiz API calls
4
+
5
+ ## Type Parameters
6
+
7
+ ### T
8
+
9
+ `T`
10
+
11
+ ## Properties
12
+
13
+ ### errCode
14
+
15
+ > **errCode**: `number`
16
+
17
+ Error code; `0` = success. Per-method code tables live in each `gamePick*` method's TSDoc.
18
+
19
+ ***
20
+
21
+ ### errMessage?
22
+
23
+ > `optional` **errMessage?**: `string`
24
+
25
+ Human-readable error message; populated when `errCode` is non-zero.
26
+
27
+ ***
28
+
29
+ ### data?
30
+
31
+ > `optional` **data?**: `T`
32
+
33
+ Response payload, present on success
@@ -49,3 +49,11 @@ Internal status of level. Not in use right now on the front-end
49
49
  ### general\_level\_progress
50
50
 
51
51
  > **general\_level\_progress**: `number`
52
+
53
+ ***
54
+
55
+ ### ordinal\_position?
56
+
57
+ > `optional` **ordinal\_position?**: `number`
58
+
59
+ 1-based position of this level within the level ladder.
@@ -0,0 +1,61 @@
1
+ # Interface: QuizEventMeta
2
+
3
+ QuizEventMeta describes metadata for a quiz-type event (custom question with answer options)
4
+
5
+ ## Extended by
6
+
7
+ - [`GamePickEventMeta`](GamePickEventMeta.md)
8
+
9
+ ## Properties
10
+
11
+ ### answers?
12
+
13
+ > `optional` **answers?**: `object`[]
14
+
15
+ List of possible answer options for the quiz question
16
+
17
+ #### value
18
+
19
+ > **value**: `string`
20
+
21
+ Answer identifier value sent on submission
22
+
23
+ #### text
24
+
25
+ > **text**: `string`
26
+
27
+ Localized display text of the answer
28
+
29
+ #### \_translations
30
+
31
+ > **\_translations**: `object`
32
+
33
+ Per-language overrides for the answer text
34
+
35
+ ##### Index Signature
36
+
37
+ \[`key`: `string`\]: `object`
38
+
39
+ ***
40
+
41
+ ### question\_image?
42
+
43
+ > `optional` **question\_image?**: `string`
44
+
45
+ URL of an image associated with the question
46
+
47
+ ***
48
+
49
+ ### result?
50
+
51
+ > `optional` **result?**: [`QuizAnswersValueType`](../enumerations/QuizAnswersValueType.md)
52
+
53
+ Correct answer value after resolution
54
+
55
+ ***
56
+
57
+ ### custom\_question
58
+
59
+ > **custom\_question**: `string`
60
+
61
+ Custom question text displayed to the user
@@ -31,3 +31,12 @@ URL of the image that represents the prize
31
31
  > **hide\_chance\_to\_win**: `boolean`
32
32
 
33
33
  Indicates whether the chance to win should be hidden in the UI.
34
+
35
+ ***
36
+
37
+ ### custom\_data?
38
+
39
+ > `optional` **custom\_data?**: `string`
40
+
41
+ Custom data field set in the backoffice prize setup.
42
+ Can be used to build custom UI for gamification.
@@ -30,3 +30,14 @@ Optional server-side error message. Present only on non-zero
30
30
  ID of the won prize. Look up in `template.prizes` to interpret
31
31
  (including `prize_type === 'no-prize'` for a configured loss
32
32
  slot). Always populated, even when `err_code !== 0`.
33
+
34
+ ***
35
+
36
+ ### request\_id
37
+
38
+ > **request\_id**: `string`
39
+
40
+ Correlation id of this spin. Pass it to
41
+ `miniGameWinAcknowledgeRequest` to finalise the win when
42
+ playing with `acknowledge: false` — no need to look it up via
43
+ `getMiniGamesHistory`.
@@ -34,6 +34,15 @@ URL of the image that represents the prize, 256x256px
34
34
 
35
35
  ***
36
36
 
37
+ ### custom\_data?
38
+
39
+ > `optional` **custom\_data?**: `string`
40
+
41
+ Custom data field set in the backoffice prize setup.
42
+ Can be used to build custom UI for gamification.
43
+
44
+ ***
45
+
37
46
  ### prizes\_per\_run
38
47
 
39
48
  > **prizes\_per\_run**: `number`
@@ -0,0 +1,5 @@
1
+ # Variable: AllRoundsGameBoardID
2
+
3
+ > `const` **AllRoundsGameBoardID**: `-1` = `-1`
4
+
5
+ Round ID constant used to request the overall/seasonal leaderboard across all rounds
@@ -86,11 +86,12 @@ For `ExplicitAcknowledge`, gate the acknowledge on the user's Claim
86
86
  tap: call `playMiniGame(template_id, { acknowledge: false })` so the
87
87
  SDK does NOT auto-finalise, then call
88
88
  [`miniGameWinAcknowledgeRequest`](../../api/classes/WSAPIMiniGames.md#minigamewinacknowledgerequest)
89
- when the user taps Claim. Pass the spin's `client_request_id`, read
90
- from the matching [`getMiniGamesHistory`](../../api/classes/WSAPIMiniGames.md#getminigameshistory)
91
- row (it appears with `is_claimed: false`). Note: "explicit claim"
92
- prizes are NOT covered by the server-side auto-acknowledge fallback,
93
- so for these you MUST acknowledge or the prize is never credited.
89
+ with the `request_id` from that play result when the user taps Claim.
90
+ (The same id also surfaces as `client_request_id` on a
91
+ [`getMiniGamesHistory`](../../api/classes/WSAPIMiniGames.md#getminigameshistory)
92
+ row if you need to recover it later.) Note: "explicit claim" prizes
93
+ are NOT covered by the server-side auto-acknowledge fallback, so for
94
+ these you MUST acknowledge or the prize is never credited.
94
95
 
95
96
  Modal contents per prize:
96
97
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartico/public-api",
3
- "version": "0.0.399",
3
+ "version": "0.0.401",
4
4
  "description": "Smartico public API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/Core/index.ts CHANGED
@@ -5,5 +5,6 @@ export * from './GetLabelInfoResponse';
5
5
  export * from './GetTranslationsRequest';
6
6
  export * from './GetTranslationsResponse';
7
7
  export * from './PublicLabelSettings';
8
+ export * from './PublicProperties';
8
9
  export * from './ResponseIdentify';
9
10
  export * from './TranslationArea';
@@ -440,9 +440,9 @@ export interface GamePickGameInfo {
440
440
  * GamesApiResponse is the standard response wrapper for all GamePick/Quiz API calls
441
441
  */
442
442
  export interface GamesApiResponse<T> {
443
- /** Error code: 0 on success, non-zero on failure */
443
+ /** Error code; `0` = success. Per-method code tables live in each `gamePick*` method's TSDoc. */
444
444
  errCode: number;
445
- /** Human-readable error message when errCode is non-zero */
445
+ /** Human-readable error message; populated when `errCode` is non-zero. */
446
446
  errMessage?: string;
447
447
  /** Response payload, present on success */
448
448
  data?: T;
@@ -452,13 +452,13 @@ export interface GamesApiResponse<T> {
452
452
  * GamePickRequestParams describes the base parameters required for GamePick API calls
453
453
  */
454
454
  export interface GamePickRequestParams {
455
- /** ID of the MatchX or Quiz game template */
455
+ /** ID of the MatchX or Quiz game template. The only field the consumer supplies. */
456
456
  saw_template_id: number;
457
- /** External user ID */
458
- ext_user_id: string;
459
- /** Smartico external user ID used for platform API calls */
460
- smartico_ext_user_id: string;
461
- /** Language code for translations (e.g. 'EN', 'DE') */
457
+ /** External user ID. Injected by the SDK from the active session; consumers omit it. */
458
+ ext_user_id?: string;
459
+ /** Platform external user ID. Injected by the SDK from the active session; consumers omit it. */
460
+ smartico_ext_user_id?: string;
461
+ /** Language code for translations (e.g. 'EN', 'DE'). Defaults to the session language. */
462
462
  lang?: string;
463
463
  }
464
464
 
@@ -10,5 +10,6 @@ export interface Level {
10
10
  required_level_counter_1: number;
11
11
  required_level_counter_2: number;
12
12
  general_level_progress: number;
13
+ /** 1-based position of this level within the level ladder. */
13
14
  ordinal_position?: number;
14
15
  }
@@ -1478,7 +1478,8 @@ class SmarticoAPI {
1478
1478
  };
1479
1479
  } else if (params) {
1480
1480
  const extraQuery = Object.entries(params)
1481
- .map(([k, v]) => `${k}=${encodeURIComponent(JSON.stringify(v))}`)
1481
+ .filter(([, v]) => v !== null && v !== undefined)
1482
+ .map(([k, v]) => `${k}=${encodeURIComponent(typeof v === 'object' ? JSON.stringify(v) : v)}`)
1482
1483
  .join('&');
1483
1484
  url += `&${extraQuery}`;
1484
1485
  }
@@ -0,0 +1,209 @@
1
+ import type { WSAPI } from './WSAPI/WSAPI';
2
+ import type { PublicProperties } from './Core/PublicProperties';
3
+
4
+ /**
5
+ * Type-only module. Contains no runtime code — interfaces, type aliases and the
6
+ * `declare global` augmentation below all compile to **nothing**, so importing
7
+ * `@smartico/public-api` for these types adds zero bytes to a consumer bundle.
8
+ *
9
+ * It exists so that any TypeScript app embedding the Smartico SDK gets the global
10
+ * `window._smartico` object fully typed *without hand-redeclaring it*. The two
11
+ * heaviest members — `api` and `vapi` — resolve to the real {@link WSAPI} class
12
+ * exported by this same package, so they can never drift out of sync with the SDK
13
+ * the way a hand-copied subset does.
14
+ *
15
+ * The `_smartico` object itself is implemented in the tracker bundle
16
+ * (`window._smartico`) and is loaded on the page by the Smartico embed snippet.
17
+ * This file only describes its *shape*; it does not provide an implementation.
18
+ *
19
+ * @document docs/SmarticoObject.md
20
+ */
21
+
22
+ /**
23
+ * Widget kinds accepted by {@link SmarticoGlobal.showWidget}. Mirrors the widget
24
+ * set the SDK supports; values are stable string identifiers.
25
+ */
26
+ export type SmarticoWidgetType =
27
+ | 'achievements'
28
+ | 'short_info'
29
+ | 'tournaments'
30
+ | 'store'
31
+ | 'inbox'
32
+ | 'missions'
33
+ | 'mini-game'
34
+ | 'match-x-2'
35
+ | 'quiz'
36
+ | 'custom-section'
37
+ | 'inbox-widget'
38
+ | 'ui-widget'
39
+ | 'liquid';
40
+
41
+ /** Presentation options for {@link SmarticoGlobal.showWidget} / {@link SmarticoGlobal.miniGame}. */
42
+ export interface SmarticoWidgetParams {
43
+ /** Theme name to render the widget with. */
44
+ theme?: string;
45
+ /** `'auto'` to size to content, or an explicit CSS height. */
46
+ height?: 'auto' | string;
47
+ /** Render inline instead of as an overlay. */
48
+ inline?: boolean;
49
+ /** Zoom factor applied to the widget iframe. */
50
+ zoom?: number;
51
+ /** Force the mobile layout regardless of viewport. */
52
+ force_mobile?: boolean;
53
+ }
54
+
55
+ /**
56
+ * Options passed to {@link SmarticoGlobal.init} / {@link SmarticoGlobal.initVisitorMode}.
57
+ * All fields are optional; only `brand_key` is commonly set.
58
+ */
59
+ export interface SmarticoInitParams {
60
+ /** Brand key for multi-brand labels. */
61
+ brand_key?: string | null;
62
+ /** Enable verbose SDK logging. */
63
+ debug?: boolean;
64
+ /** Initial UI language (e.g. `'EN'`). */
65
+ lang?: string;
66
+ /** Override the SDK WebSocket endpoint. */
67
+ ws_url?: string | null;
68
+ /** Allow additional forward-compatible init options. */
69
+ [key: string]: unknown;
70
+ }
71
+
72
+ /**
73
+ * The global `_smartico` object exposed by the Smartico embed on `window`.
74
+ *
75
+ * `api` and `vapi` are the {@link WSAPI} surface documented across this package's
76
+ * API reference; every other member is a core SDK control method implemented in
77
+ * the tracker bundle (see the `_smartico` object reference doc).
78
+ *
79
+ * @document docs/SmarticoObject.md
80
+ */
81
+ export interface SmarticoGlobal {
82
+ /**
83
+ * The authenticated WebSocket API surface (`_smartico.api.*`). Available once
84
+ * the SDK has initialized and identified the user — gate calls on
85
+ * {@link SmarticoGlobal.checkSuccessfullyIdentify}.
86
+ */
87
+ api: WSAPI;
88
+
89
+ /**
90
+ * Visitor-mode (unauthenticated) API surface for the given language. Returns a
91
+ * {@link WSAPI} scoped to anonymous visitors.
92
+ */
93
+ vapi(language: string): WSAPI;
94
+
95
+ /**
96
+ * `true` once the SDK is initialized **and** the user has been successfully
97
+ * identified. Use as a synchronous gate before calling any `api.*` method.
98
+ */
99
+ checkSuccessfullyIdentify(): boolean;
100
+
101
+ /** Initialize the SDK for an identified integration. */
102
+ init(labelApiKey: string, params?: SmarticoInitParams): void;
103
+ /** Initialize the SDK in visitor (anonymous) mode. */
104
+ initVisitorMode(labelApiKey: string, params?: SmarticoInitParams): void;
105
+ /** Identify the current user against the label. */
106
+ identify(extUserId: string, hash: string, payload?: Record<string, unknown>): Promise<void>;
107
+ /** Mark an identified user as online for the given language. */
108
+ online(extUserId: string, language: string, userHash: string, payload?: Record<string, unknown>): Promise<void>;
109
+ /** Re-run the login flow for the current session. */
110
+ login(language?: string, payload?: Record<string, unknown>): void;
111
+ /** Log the current user out of the SDK session. */
112
+ logout(payload?: Record<string, unknown>): void;
113
+ /** Clear SDK state/cookies. */
114
+ clear(params?: Record<string, unknown>): void;
115
+ /** Switch the active UI language. */
116
+ changeLanguage(language: string): void;
117
+
118
+ /**
119
+ * Subscribe to a lifecycle/engagement callback. Pass `null` as the handler to
120
+ * unsubscribe. See the callbacks reference for available keys.
121
+ */
122
+ on(event: string, cb: null | ((...args: any[]) => void), params?: Record<string, unknown>): void;
123
+ /** Remove a previously registered callback. */
124
+ off(event: string, cb: null | ((...args: any[]) => void)): void;
125
+
126
+ /** Trigger a Smartico deep link. */
127
+ dp(deepLink: string): void;
128
+ /** Open a Smartico widget overlay/inline. */
129
+ showWidget(widgetType: SmarticoWidgetType, params?: SmarticoWidgetParams): void;
130
+ /** Open a mini-game widget for the given template. */
131
+ miniGame(sawTemplateId: string, params: SmarticoWidgetParams, pendingMessageId?: string | number): void;
132
+ /** Render a banner into a host element. */
133
+ showBanner(params: { dom_id: string; placement_key: string }): void;
134
+ /** Push data into an already-rendered banner. */
135
+ sendDataToBanner(params: { placement_key: string; data: Record<string, unknown> }): void;
136
+ /** Embed the gamification block into a host element. */
137
+ gamificationBlock(params: { dom_id: string; url: string; fit?: 'content' | 'fill' }): void;
138
+
139
+ /** Snapshot of the user's public gamification properties. */
140
+ getPublicProps(): PublicProperties;
141
+ /** Add/remove/replace/clear the user's public tags. */
142
+ updatePublicTags(operation: 'add' | 'remove' | 'replace' | 'clear', tags?: string[]): void;
143
+ /** Set UTM attribution for the session. */
144
+ setUTMs(source: string, campaign: string): void;
145
+ /** Record the last login entry point. */
146
+ setLoginEntry(entry: string): void;
147
+ /** Set the user's avatar. */
148
+ setAvatar(avatarId: string): void;
149
+ /** Set the user's nickname. */
150
+ setNickname(nickname: string): void;
151
+ /** Set the active UI skin. */
152
+ setSkin(skinName: string): void;
153
+
154
+ /** Prompt the browser for web-push permission. */
155
+ requestPushPermissions(): void;
156
+ /** Register a native push token (mobile webviews). */
157
+ registerNativePushToken(token: string, platform?: number, appPackageId?: string): void;
158
+
159
+ /** Send a client event. */
160
+ event(eventType: string, payload?: Record<string, unknown>): void;
161
+ /** Send a client action. */
162
+ action(actionValue: unknown, extraPayload?: Record<string, unknown>): void;
163
+ /** Report a client-side error to the server. */
164
+ sendServerError(message: string): void;
165
+ /** Send a client-side debug message to the server. */
166
+ sendServerDebug(message: string): void;
167
+
168
+ /** Temporarily suspend/resume automatic popups. */
169
+ suspendPopups(flag: boolean): void;
170
+ /** Temporarily suspend/resume the inbox. */
171
+ suspendInbox(flag: boolean): void;
172
+ /** Temporarily suspend/resume mini-games. */
173
+ suspendMiniGames(flag: boolean): void;
174
+
175
+ /** Show a visitor-mode game. */
176
+ showVisitorGame(params: Record<string, unknown>): void;
177
+ /** Convert a visitor-mode win into an identified reward. */
178
+ convertVisitorGame(visitorWinUuid: string): void;
179
+
180
+ /** Start landing-page analytics for a template. */
181
+ startLpAnalytics(params: { lp_template_uuid: string; shadow_root?: ShadowRoot | null }): void;
182
+ /** Send a landing-page analytics activity. */
183
+ sendAnalytics(activityId: number, viewTimeSec?: number): void;
184
+
185
+ /** `true` on mobile viewports. */
186
+ isMobile(): boolean;
187
+ /** Parse the current URL query into a map. */
188
+ parseUrl(): Record<string, string>;
189
+ /** Parse the current URL hash into a map. */
190
+ parseUrlHash(): Record<string, string>;
191
+ }
192
+
193
+ declare global {
194
+ interface Window {
195
+ /**
196
+ * Params injected by the Smartico widget runtime (`widget.js`) when a widget
197
+ * is embedded via `_smartico.showWidget` / a widget script tag. Keys mirror
198
+ * the params passed in the embedding snippet (e.g. `id`).
199
+ */
200
+ __SMARTICO_LP_PARAMS__?: Record<string, string | number>;
201
+
202
+ /**
203
+ * The global Smartico SDK object, present once the embed snippet has loaded.
204
+ * Optional because it is `undefined` until the script initializes — guard
205
+ * access (`window._smartico?.…`) or gate on `checkSuccessfullyIdentify()`.
206
+ */
207
+ _smartico?: SmarticoGlobal;
208
+ }
209
+ }
@@ -307,9 +307,9 @@ export class WSAPIGamePick extends WSAPIAvatars {
307
307
  * **Side effects**
308
308
  * - First successful submit deducts the buy-in (Points / Gems / Diamonds /
309
309
  * one Spin) per `saw_buyin_type_id`.
310
- * - Reports a `minigame_matchx_prediction` event to the operator's event log.
311
- * - Updates the round's participant counter (`users_cnt`) and per-event
312
- * counters (`num_users`).
310
+ * - Records the user's participation against the round and its events
311
+ * server-side and reports a prediction event to the operator's activity
312
+ * stream.
313
313
  * - Score is awarded after the operator resolves the round
314
314
  * ({@link GPRoundStatus} = `RoundResolved`).
315
315
  *
@@ -408,9 +408,9 @@ export class WSAPIGamePick extends WSAPIAvatars {
408
408
  * **Idempotency**: identical to {@link gamePickSubmitSelection} — re-submit
409
409
  * returns `errCode: 3` and never double-charges the buy-in.
410
410
  *
411
- * **Side effects**: identical to {@link gamePickSubmitSelection}, with the
412
- * reported event being `minigame_quiz_prediction` instead of
413
- * `minigame_matchx_prediction`.
411
+ * **Side effects**: identical to {@link gamePickSubmitSelection} — buy-in
412
+ * deduction on first submit, participation recorded, score awarded on round
413
+ * resolution.
414
414
  *
415
415
  * **Visitor mode**: not supported.
416
416
  *