@hyve-sdk/js 2.11.2 → 2.12.0

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/dist/index.d.mts CHANGED
@@ -507,6 +507,59 @@ declare class HyveClient {
507
507
  * @returns Promise resolving to boolean indicating success
508
508
  */
509
509
  sendTelemetry(eventLocation: string, eventCategory: string, eventAction: string, eventSubCategory?: string | null, eventSubAction?: string | null, eventDetails?: Record<string, any> | string | null, platformId?: string | null): Promise<boolean>;
510
+ /**
511
+ * Required lifecycle telemetry — Session start.
512
+ * See https://docs.hyve.gg/docs/telemetry#required-lifecycle-events
513
+ */
514
+ sessionStart(): Promise<boolean>;
515
+ /**
516
+ * Required lifecycle telemetry — Session end.
517
+ */
518
+ sessionEnd(): Promise<boolean>;
519
+ /**
520
+ * Required lifecycle telemetry — Lobby loading start.
521
+ */
522
+ lobbyLoadingStart(): Promise<boolean>;
523
+ /**
524
+ * Required lifecycle telemetry — Lobby loading end.
525
+ */
526
+ lobbyLoadingEnd(): Promise<boolean>;
527
+ /**
528
+ * Required lifecycle telemetry — Game loading start.
529
+ */
530
+ gameLoadingStart(): Promise<boolean>;
531
+ /**
532
+ * Required lifecycle telemetry — Game loading end.
533
+ */
534
+ gameLoadingEnd(): Promise<boolean>;
535
+ /**
536
+ * Required lifecycle telemetry — Lobby initialization.
537
+ */
538
+ lobbyInit(): Promise<boolean>;
539
+ /**
540
+ * Required lifecycle telemetry — Gameplay end.
541
+ * Also notifies CrazyGames that gameplay has stopped.
542
+ */
543
+ gameplayEnd(): Promise<boolean>;
544
+ /**
545
+ * Required lifecycle telemetry — Store opened.
546
+ */
547
+ storeOpen(): Promise<boolean>;
548
+ /**
549
+ * Required lifecycle telemetry — Purchase complete.
550
+ * @param itemName Name of the purchased item (required by the platform)
551
+ */
552
+ purchaseComplete(itemName: string): Promise<boolean>;
553
+ /**
554
+ * Required lifecycle telemetry — Purchase failed.
555
+ * @param itemName Name of the item the purchase was for
556
+ */
557
+ purchaseFail(itemName: string): Promise<boolean>;
558
+ /**
559
+ * Required lifecycle telemetry — Purchase cancelled.
560
+ * @param itemName Name of the item the purchase was for
561
+ */
562
+ purchaseCancel(itemName: string): Promise<boolean>;
510
563
  /**
511
564
  * Makes an authenticated API call using the JWT token
512
565
  * @param endpoint API endpoint path (will be appended to base URL)
@@ -656,10 +709,10 @@ declare class HyveClient {
656
709
  */
657
710
  showAd(type: AdType): Promise<AdResult>;
658
711
  /**
659
- * Notifies CrazyGames that gameplay has started.
660
- * No-op on other platforms.
712
+ * Required lifecycle telemetry Gameplay start.
713
+ * Also notifies CrazyGames that gameplay has started.
661
714
  */
662
- gameplayStart(): Promise<void>;
715
+ gameplayStart(): Promise<boolean>;
663
716
  /**
664
717
  * Notifies CrazyGames that gameplay has stopped.
665
718
  * No-op on other platforms.
package/dist/index.d.ts CHANGED
@@ -507,6 +507,59 @@ declare class HyveClient {
507
507
  * @returns Promise resolving to boolean indicating success
508
508
  */
509
509
  sendTelemetry(eventLocation: string, eventCategory: string, eventAction: string, eventSubCategory?: string | null, eventSubAction?: string | null, eventDetails?: Record<string, any> | string | null, platformId?: string | null): Promise<boolean>;
510
+ /**
511
+ * Required lifecycle telemetry — Session start.
512
+ * See https://docs.hyve.gg/docs/telemetry#required-lifecycle-events
513
+ */
514
+ sessionStart(): Promise<boolean>;
515
+ /**
516
+ * Required lifecycle telemetry — Session end.
517
+ */
518
+ sessionEnd(): Promise<boolean>;
519
+ /**
520
+ * Required lifecycle telemetry — Lobby loading start.
521
+ */
522
+ lobbyLoadingStart(): Promise<boolean>;
523
+ /**
524
+ * Required lifecycle telemetry — Lobby loading end.
525
+ */
526
+ lobbyLoadingEnd(): Promise<boolean>;
527
+ /**
528
+ * Required lifecycle telemetry — Game loading start.
529
+ */
530
+ gameLoadingStart(): Promise<boolean>;
531
+ /**
532
+ * Required lifecycle telemetry — Game loading end.
533
+ */
534
+ gameLoadingEnd(): Promise<boolean>;
535
+ /**
536
+ * Required lifecycle telemetry — Lobby initialization.
537
+ */
538
+ lobbyInit(): Promise<boolean>;
539
+ /**
540
+ * Required lifecycle telemetry — Gameplay end.
541
+ * Also notifies CrazyGames that gameplay has stopped.
542
+ */
543
+ gameplayEnd(): Promise<boolean>;
544
+ /**
545
+ * Required lifecycle telemetry — Store opened.
546
+ */
547
+ storeOpen(): Promise<boolean>;
548
+ /**
549
+ * Required lifecycle telemetry — Purchase complete.
550
+ * @param itemName Name of the purchased item (required by the platform)
551
+ */
552
+ purchaseComplete(itemName: string): Promise<boolean>;
553
+ /**
554
+ * Required lifecycle telemetry — Purchase failed.
555
+ * @param itemName Name of the item the purchase was for
556
+ */
557
+ purchaseFail(itemName: string): Promise<boolean>;
558
+ /**
559
+ * Required lifecycle telemetry — Purchase cancelled.
560
+ * @param itemName Name of the item the purchase was for
561
+ */
562
+ purchaseCancel(itemName: string): Promise<boolean>;
510
563
  /**
511
564
  * Makes an authenticated API call using the JWT token
512
565
  * @param endpoint API endpoint path (will be appended to base URL)
@@ -656,10 +709,10 @@ declare class HyveClient {
656
709
  */
657
710
  showAd(type: AdType): Promise<AdResult>;
658
711
  /**
659
- * Notifies CrazyGames that gameplay has started.
660
- * No-op on other platforms.
712
+ * Required lifecycle telemetry Gameplay start.
713
+ * Also notifies CrazyGames that gameplay has started.
661
714
  */
662
- gameplayStart(): Promise<void>;
715
+ gameplayStart(): Promise<boolean>;
663
716
  /**
664
717
  * Notifies CrazyGames that gameplay has stopped.
665
718
  * No-op on other platforms.
package/dist/index.js CHANGED
@@ -2122,6 +2122,93 @@ var HyveClient = class {
2122
2122
  return false;
2123
2123
  }
2124
2124
  }
2125
+ /**
2126
+ * Required lifecycle telemetry — Session start.
2127
+ * See https://docs.hyve.gg/docs/telemetry#required-lifecycle-events
2128
+ */
2129
+ async sessionStart() {
2130
+ return this.sendTelemetry("game", "session", "start");
2131
+ }
2132
+ /**
2133
+ * Required lifecycle telemetry — Session end.
2134
+ */
2135
+ async sessionEnd() {
2136
+ return this.sendTelemetry("game", "session", "end");
2137
+ }
2138
+ /**
2139
+ * Required lifecycle telemetry — Lobby loading start.
2140
+ */
2141
+ async lobbyLoadingStart() {
2142
+ return this.sendTelemetry("game", "loading", "start");
2143
+ }
2144
+ /**
2145
+ * Required lifecycle telemetry — Lobby loading end.
2146
+ */
2147
+ async lobbyLoadingEnd() {
2148
+ return this.sendTelemetry("game", "loading", "end");
2149
+ }
2150
+ /**
2151
+ * Required lifecycle telemetry — Game loading start.
2152
+ */
2153
+ async gameLoadingStart() {
2154
+ return this.sendTelemetry("game", "game_loading", "start");
2155
+ }
2156
+ /**
2157
+ * Required lifecycle telemetry — Game loading end.
2158
+ */
2159
+ async gameLoadingEnd() {
2160
+ return this.sendTelemetry("game", "game_loading", "end");
2161
+ }
2162
+ /**
2163
+ * Required lifecycle telemetry — Lobby initialization.
2164
+ */
2165
+ async lobbyInit() {
2166
+ return this.sendTelemetry("game", "lobby", "init");
2167
+ }
2168
+ /**
2169
+ * Required lifecycle telemetry — Gameplay end.
2170
+ * Also notifies CrazyGames that gameplay has stopped.
2171
+ */
2172
+ async gameplayEnd() {
2173
+ if (this.crazyGamesService) {
2174
+ if (this.crazyGamesInitPromise) await this.crazyGamesInitPromise;
2175
+ this.crazyGamesService.gameplayStop();
2176
+ }
2177
+ return this.sendTelemetry("game", "gameplay", "end");
2178
+ }
2179
+ /**
2180
+ * Required lifecycle telemetry — Store opened.
2181
+ */
2182
+ async storeOpen() {
2183
+ return this.sendTelemetry("game", "store", "start");
2184
+ }
2185
+ /**
2186
+ * Required lifecycle telemetry — Purchase complete.
2187
+ * @param itemName Name of the purchased item (required by the platform)
2188
+ */
2189
+ async purchaseComplete(itemName) {
2190
+ return this.sendTelemetry("game", "purchase", "complete", null, null, {
2191
+ item_name: itemName
2192
+ });
2193
+ }
2194
+ /**
2195
+ * Required lifecycle telemetry — Purchase failed.
2196
+ * @param itemName Name of the item the purchase was for
2197
+ */
2198
+ async purchaseFail(itemName) {
2199
+ return this.sendTelemetry("game", "purchase", "fail", null, null, {
2200
+ item_name: itemName
2201
+ });
2202
+ }
2203
+ /**
2204
+ * Required lifecycle telemetry — Purchase cancelled.
2205
+ * @param itemName Name of the item the purchase was for
2206
+ */
2207
+ async purchaseCancel(itemName) {
2208
+ return this.sendTelemetry("game", "purchase", "cancel", null, null, {
2209
+ item_name: itemName
2210
+ });
2211
+ }
2125
2212
  /**
2126
2213
  * Makes an authenticated API call using the JWT token
2127
2214
  * @param endpoint API endpoint path (will be appended to base URL)
@@ -2461,14 +2548,15 @@ var HyveClient = class {
2461
2548
  return this.adsService.show(type);
2462
2549
  }
2463
2550
  /**
2464
- * Notifies CrazyGames that gameplay has started.
2465
- * No-op on other platforms.
2551
+ * Required lifecycle telemetry Gameplay start.
2552
+ * Also notifies CrazyGames that gameplay has started.
2466
2553
  */
2467
2554
  async gameplayStart() {
2468
2555
  if (this.crazyGamesService) {
2469
2556
  if (this.crazyGamesInitPromise) await this.crazyGamesInitPromise;
2470
2557
  this.crazyGamesService.gameplayStart();
2471
2558
  }
2559
+ return this.sendTelemetry("game", "gameplay", "start");
2472
2560
  }
2473
2561
  /**
2474
2562
  * Notifies CrazyGames that gameplay has stopped.
package/dist/index.mjs CHANGED
@@ -2082,6 +2082,93 @@ var HyveClient = class {
2082
2082
  return false;
2083
2083
  }
2084
2084
  }
2085
+ /**
2086
+ * Required lifecycle telemetry — Session start.
2087
+ * See https://docs.hyve.gg/docs/telemetry#required-lifecycle-events
2088
+ */
2089
+ async sessionStart() {
2090
+ return this.sendTelemetry("game", "session", "start");
2091
+ }
2092
+ /**
2093
+ * Required lifecycle telemetry — Session end.
2094
+ */
2095
+ async sessionEnd() {
2096
+ return this.sendTelemetry("game", "session", "end");
2097
+ }
2098
+ /**
2099
+ * Required lifecycle telemetry — Lobby loading start.
2100
+ */
2101
+ async lobbyLoadingStart() {
2102
+ return this.sendTelemetry("game", "loading", "start");
2103
+ }
2104
+ /**
2105
+ * Required lifecycle telemetry — Lobby loading end.
2106
+ */
2107
+ async lobbyLoadingEnd() {
2108
+ return this.sendTelemetry("game", "loading", "end");
2109
+ }
2110
+ /**
2111
+ * Required lifecycle telemetry — Game loading start.
2112
+ */
2113
+ async gameLoadingStart() {
2114
+ return this.sendTelemetry("game", "game_loading", "start");
2115
+ }
2116
+ /**
2117
+ * Required lifecycle telemetry — Game loading end.
2118
+ */
2119
+ async gameLoadingEnd() {
2120
+ return this.sendTelemetry("game", "game_loading", "end");
2121
+ }
2122
+ /**
2123
+ * Required lifecycle telemetry — Lobby initialization.
2124
+ */
2125
+ async lobbyInit() {
2126
+ return this.sendTelemetry("game", "lobby", "init");
2127
+ }
2128
+ /**
2129
+ * Required lifecycle telemetry — Gameplay end.
2130
+ * Also notifies CrazyGames that gameplay has stopped.
2131
+ */
2132
+ async gameplayEnd() {
2133
+ if (this.crazyGamesService) {
2134
+ if (this.crazyGamesInitPromise) await this.crazyGamesInitPromise;
2135
+ this.crazyGamesService.gameplayStop();
2136
+ }
2137
+ return this.sendTelemetry("game", "gameplay", "end");
2138
+ }
2139
+ /**
2140
+ * Required lifecycle telemetry — Store opened.
2141
+ */
2142
+ async storeOpen() {
2143
+ return this.sendTelemetry("game", "store", "start");
2144
+ }
2145
+ /**
2146
+ * Required lifecycle telemetry — Purchase complete.
2147
+ * @param itemName Name of the purchased item (required by the platform)
2148
+ */
2149
+ async purchaseComplete(itemName) {
2150
+ return this.sendTelemetry("game", "purchase", "complete", null, null, {
2151
+ item_name: itemName
2152
+ });
2153
+ }
2154
+ /**
2155
+ * Required lifecycle telemetry — Purchase failed.
2156
+ * @param itemName Name of the item the purchase was for
2157
+ */
2158
+ async purchaseFail(itemName) {
2159
+ return this.sendTelemetry("game", "purchase", "fail", null, null, {
2160
+ item_name: itemName
2161
+ });
2162
+ }
2163
+ /**
2164
+ * Required lifecycle telemetry — Purchase cancelled.
2165
+ * @param itemName Name of the item the purchase was for
2166
+ */
2167
+ async purchaseCancel(itemName) {
2168
+ return this.sendTelemetry("game", "purchase", "cancel", null, null, {
2169
+ item_name: itemName
2170
+ });
2171
+ }
2085
2172
  /**
2086
2173
  * Makes an authenticated API call using the JWT token
2087
2174
  * @param endpoint API endpoint path (will be appended to base URL)
@@ -2421,14 +2508,15 @@ var HyveClient = class {
2421
2508
  return this.adsService.show(type);
2422
2509
  }
2423
2510
  /**
2424
- * Notifies CrazyGames that gameplay has started.
2425
- * No-op on other platforms.
2511
+ * Required lifecycle telemetry Gameplay start.
2512
+ * Also notifies CrazyGames that gameplay has started.
2426
2513
  */
2427
2514
  async gameplayStart() {
2428
2515
  if (this.crazyGamesService) {
2429
2516
  if (this.crazyGamesInitPromise) await this.crazyGamesInitPromise;
2430
2517
  this.crazyGamesService.gameplayStart();
2431
2518
  }
2519
+ return this.sendTelemetry("game", "gameplay", "start");
2432
2520
  }
2433
2521
  /**
2434
2522
  * Notifies CrazyGames that gameplay has stopped.
package/dist/react.d.mts CHANGED
@@ -282,6 +282,59 @@ declare class HyveClient {
282
282
  * @returns Promise resolving to boolean indicating success
283
283
  */
284
284
  sendTelemetry(eventLocation: string, eventCategory: string, eventAction: string, eventSubCategory?: string | null, eventSubAction?: string | null, eventDetails?: Record<string, any> | string | null, platformId?: string | null): Promise<boolean>;
285
+ /**
286
+ * Required lifecycle telemetry — Session start.
287
+ * See https://docs.hyve.gg/docs/telemetry#required-lifecycle-events
288
+ */
289
+ sessionStart(): Promise<boolean>;
290
+ /**
291
+ * Required lifecycle telemetry — Session end.
292
+ */
293
+ sessionEnd(): Promise<boolean>;
294
+ /**
295
+ * Required lifecycle telemetry — Lobby loading start.
296
+ */
297
+ lobbyLoadingStart(): Promise<boolean>;
298
+ /**
299
+ * Required lifecycle telemetry — Lobby loading end.
300
+ */
301
+ lobbyLoadingEnd(): Promise<boolean>;
302
+ /**
303
+ * Required lifecycle telemetry — Game loading start.
304
+ */
305
+ gameLoadingStart(): Promise<boolean>;
306
+ /**
307
+ * Required lifecycle telemetry — Game loading end.
308
+ */
309
+ gameLoadingEnd(): Promise<boolean>;
310
+ /**
311
+ * Required lifecycle telemetry — Lobby initialization.
312
+ */
313
+ lobbyInit(): Promise<boolean>;
314
+ /**
315
+ * Required lifecycle telemetry — Gameplay end.
316
+ * Also notifies CrazyGames that gameplay has stopped.
317
+ */
318
+ gameplayEnd(): Promise<boolean>;
319
+ /**
320
+ * Required lifecycle telemetry — Store opened.
321
+ */
322
+ storeOpen(): Promise<boolean>;
323
+ /**
324
+ * Required lifecycle telemetry — Purchase complete.
325
+ * @param itemName Name of the purchased item (required by the platform)
326
+ */
327
+ purchaseComplete(itemName: string): Promise<boolean>;
328
+ /**
329
+ * Required lifecycle telemetry — Purchase failed.
330
+ * @param itemName Name of the item the purchase was for
331
+ */
332
+ purchaseFail(itemName: string): Promise<boolean>;
333
+ /**
334
+ * Required lifecycle telemetry — Purchase cancelled.
335
+ * @param itemName Name of the item the purchase was for
336
+ */
337
+ purchaseCancel(itemName: string): Promise<boolean>;
285
338
  /**
286
339
  * Makes an authenticated API call using the JWT token
287
340
  * @param endpoint API endpoint path (will be appended to base URL)
@@ -431,10 +484,10 @@ declare class HyveClient {
431
484
  */
432
485
  showAd(type: AdType): Promise<AdResult>;
433
486
  /**
434
- * Notifies CrazyGames that gameplay has started.
435
- * No-op on other platforms.
487
+ * Required lifecycle telemetry Gameplay start.
488
+ * Also notifies CrazyGames that gameplay has started.
436
489
  */
437
- gameplayStart(): Promise<void>;
490
+ gameplayStart(): Promise<boolean>;
438
491
  /**
439
492
  * Notifies CrazyGames that gameplay has stopped.
440
493
  * No-op on other platforms.
package/dist/react.d.ts CHANGED
@@ -282,6 +282,59 @@ declare class HyveClient {
282
282
  * @returns Promise resolving to boolean indicating success
283
283
  */
284
284
  sendTelemetry(eventLocation: string, eventCategory: string, eventAction: string, eventSubCategory?: string | null, eventSubAction?: string | null, eventDetails?: Record<string, any> | string | null, platformId?: string | null): Promise<boolean>;
285
+ /**
286
+ * Required lifecycle telemetry — Session start.
287
+ * See https://docs.hyve.gg/docs/telemetry#required-lifecycle-events
288
+ */
289
+ sessionStart(): Promise<boolean>;
290
+ /**
291
+ * Required lifecycle telemetry — Session end.
292
+ */
293
+ sessionEnd(): Promise<boolean>;
294
+ /**
295
+ * Required lifecycle telemetry — Lobby loading start.
296
+ */
297
+ lobbyLoadingStart(): Promise<boolean>;
298
+ /**
299
+ * Required lifecycle telemetry — Lobby loading end.
300
+ */
301
+ lobbyLoadingEnd(): Promise<boolean>;
302
+ /**
303
+ * Required lifecycle telemetry — Game loading start.
304
+ */
305
+ gameLoadingStart(): Promise<boolean>;
306
+ /**
307
+ * Required lifecycle telemetry — Game loading end.
308
+ */
309
+ gameLoadingEnd(): Promise<boolean>;
310
+ /**
311
+ * Required lifecycle telemetry — Lobby initialization.
312
+ */
313
+ lobbyInit(): Promise<boolean>;
314
+ /**
315
+ * Required lifecycle telemetry — Gameplay end.
316
+ * Also notifies CrazyGames that gameplay has stopped.
317
+ */
318
+ gameplayEnd(): Promise<boolean>;
319
+ /**
320
+ * Required lifecycle telemetry — Store opened.
321
+ */
322
+ storeOpen(): Promise<boolean>;
323
+ /**
324
+ * Required lifecycle telemetry — Purchase complete.
325
+ * @param itemName Name of the purchased item (required by the platform)
326
+ */
327
+ purchaseComplete(itemName: string): Promise<boolean>;
328
+ /**
329
+ * Required lifecycle telemetry — Purchase failed.
330
+ * @param itemName Name of the item the purchase was for
331
+ */
332
+ purchaseFail(itemName: string): Promise<boolean>;
333
+ /**
334
+ * Required lifecycle telemetry — Purchase cancelled.
335
+ * @param itemName Name of the item the purchase was for
336
+ */
337
+ purchaseCancel(itemName: string): Promise<boolean>;
285
338
  /**
286
339
  * Makes an authenticated API call using the JWT token
287
340
  * @param endpoint API endpoint path (will be appended to base URL)
@@ -431,10 +484,10 @@ declare class HyveClient {
431
484
  */
432
485
  showAd(type: AdType): Promise<AdResult>;
433
486
  /**
434
- * Notifies CrazyGames that gameplay has started.
435
- * No-op on other platforms.
487
+ * Required lifecycle telemetry Gameplay start.
488
+ * Also notifies CrazyGames that gameplay has started.
436
489
  */
437
- gameplayStart(): Promise<void>;
490
+ gameplayStart(): Promise<boolean>;
438
491
  /**
439
492
  * Notifies CrazyGames that gameplay has stopped.
440
493
  * No-op on other platforms.
package/dist/react.js CHANGED
@@ -2077,6 +2077,93 @@ var HyveClient = class {
2077
2077
  return false;
2078
2078
  }
2079
2079
  }
2080
+ /**
2081
+ * Required lifecycle telemetry — Session start.
2082
+ * See https://docs.hyve.gg/docs/telemetry#required-lifecycle-events
2083
+ */
2084
+ async sessionStart() {
2085
+ return this.sendTelemetry("game", "session", "start");
2086
+ }
2087
+ /**
2088
+ * Required lifecycle telemetry — Session end.
2089
+ */
2090
+ async sessionEnd() {
2091
+ return this.sendTelemetry("game", "session", "end");
2092
+ }
2093
+ /**
2094
+ * Required lifecycle telemetry — Lobby loading start.
2095
+ */
2096
+ async lobbyLoadingStart() {
2097
+ return this.sendTelemetry("game", "loading", "start");
2098
+ }
2099
+ /**
2100
+ * Required lifecycle telemetry — Lobby loading end.
2101
+ */
2102
+ async lobbyLoadingEnd() {
2103
+ return this.sendTelemetry("game", "loading", "end");
2104
+ }
2105
+ /**
2106
+ * Required lifecycle telemetry — Game loading start.
2107
+ */
2108
+ async gameLoadingStart() {
2109
+ return this.sendTelemetry("game", "game_loading", "start");
2110
+ }
2111
+ /**
2112
+ * Required lifecycle telemetry — Game loading end.
2113
+ */
2114
+ async gameLoadingEnd() {
2115
+ return this.sendTelemetry("game", "game_loading", "end");
2116
+ }
2117
+ /**
2118
+ * Required lifecycle telemetry — Lobby initialization.
2119
+ */
2120
+ async lobbyInit() {
2121
+ return this.sendTelemetry("game", "lobby", "init");
2122
+ }
2123
+ /**
2124
+ * Required lifecycle telemetry — Gameplay end.
2125
+ * Also notifies CrazyGames that gameplay has stopped.
2126
+ */
2127
+ async gameplayEnd() {
2128
+ if (this.crazyGamesService) {
2129
+ if (this.crazyGamesInitPromise) await this.crazyGamesInitPromise;
2130
+ this.crazyGamesService.gameplayStop();
2131
+ }
2132
+ return this.sendTelemetry("game", "gameplay", "end");
2133
+ }
2134
+ /**
2135
+ * Required lifecycle telemetry — Store opened.
2136
+ */
2137
+ async storeOpen() {
2138
+ return this.sendTelemetry("game", "store", "start");
2139
+ }
2140
+ /**
2141
+ * Required lifecycle telemetry — Purchase complete.
2142
+ * @param itemName Name of the purchased item (required by the platform)
2143
+ */
2144
+ async purchaseComplete(itemName) {
2145
+ return this.sendTelemetry("game", "purchase", "complete", null, null, {
2146
+ item_name: itemName
2147
+ });
2148
+ }
2149
+ /**
2150
+ * Required lifecycle telemetry — Purchase failed.
2151
+ * @param itemName Name of the item the purchase was for
2152
+ */
2153
+ async purchaseFail(itemName) {
2154
+ return this.sendTelemetry("game", "purchase", "fail", null, null, {
2155
+ item_name: itemName
2156
+ });
2157
+ }
2158
+ /**
2159
+ * Required lifecycle telemetry — Purchase cancelled.
2160
+ * @param itemName Name of the item the purchase was for
2161
+ */
2162
+ async purchaseCancel(itemName) {
2163
+ return this.sendTelemetry("game", "purchase", "cancel", null, null, {
2164
+ item_name: itemName
2165
+ });
2166
+ }
2080
2167
  /**
2081
2168
  * Makes an authenticated API call using the JWT token
2082
2169
  * @param endpoint API endpoint path (will be appended to base URL)
@@ -2416,14 +2503,15 @@ var HyveClient = class {
2416
2503
  return this.adsService.show(type);
2417
2504
  }
2418
2505
  /**
2419
- * Notifies CrazyGames that gameplay has started.
2420
- * No-op on other platforms.
2506
+ * Required lifecycle telemetry Gameplay start.
2507
+ * Also notifies CrazyGames that gameplay has started.
2421
2508
  */
2422
2509
  async gameplayStart() {
2423
2510
  if (this.crazyGamesService) {
2424
2511
  if (this.crazyGamesInitPromise) await this.crazyGamesInitPromise;
2425
2512
  this.crazyGamesService.gameplayStart();
2426
2513
  }
2514
+ return this.sendTelemetry("game", "gameplay", "start");
2427
2515
  }
2428
2516
  /**
2429
2517
  * Notifies CrazyGames that gameplay has stopped.
package/dist/react.mjs CHANGED
@@ -2055,6 +2055,93 @@ var HyveClient = class {
2055
2055
  return false;
2056
2056
  }
2057
2057
  }
2058
+ /**
2059
+ * Required lifecycle telemetry — Session start.
2060
+ * See https://docs.hyve.gg/docs/telemetry#required-lifecycle-events
2061
+ */
2062
+ async sessionStart() {
2063
+ return this.sendTelemetry("game", "session", "start");
2064
+ }
2065
+ /**
2066
+ * Required lifecycle telemetry — Session end.
2067
+ */
2068
+ async sessionEnd() {
2069
+ return this.sendTelemetry("game", "session", "end");
2070
+ }
2071
+ /**
2072
+ * Required lifecycle telemetry — Lobby loading start.
2073
+ */
2074
+ async lobbyLoadingStart() {
2075
+ return this.sendTelemetry("game", "loading", "start");
2076
+ }
2077
+ /**
2078
+ * Required lifecycle telemetry — Lobby loading end.
2079
+ */
2080
+ async lobbyLoadingEnd() {
2081
+ return this.sendTelemetry("game", "loading", "end");
2082
+ }
2083
+ /**
2084
+ * Required lifecycle telemetry — Game loading start.
2085
+ */
2086
+ async gameLoadingStart() {
2087
+ return this.sendTelemetry("game", "game_loading", "start");
2088
+ }
2089
+ /**
2090
+ * Required lifecycle telemetry — Game loading end.
2091
+ */
2092
+ async gameLoadingEnd() {
2093
+ return this.sendTelemetry("game", "game_loading", "end");
2094
+ }
2095
+ /**
2096
+ * Required lifecycle telemetry — Lobby initialization.
2097
+ */
2098
+ async lobbyInit() {
2099
+ return this.sendTelemetry("game", "lobby", "init");
2100
+ }
2101
+ /**
2102
+ * Required lifecycle telemetry — Gameplay end.
2103
+ * Also notifies CrazyGames that gameplay has stopped.
2104
+ */
2105
+ async gameplayEnd() {
2106
+ if (this.crazyGamesService) {
2107
+ if (this.crazyGamesInitPromise) await this.crazyGamesInitPromise;
2108
+ this.crazyGamesService.gameplayStop();
2109
+ }
2110
+ return this.sendTelemetry("game", "gameplay", "end");
2111
+ }
2112
+ /**
2113
+ * Required lifecycle telemetry — Store opened.
2114
+ */
2115
+ async storeOpen() {
2116
+ return this.sendTelemetry("game", "store", "start");
2117
+ }
2118
+ /**
2119
+ * Required lifecycle telemetry — Purchase complete.
2120
+ * @param itemName Name of the purchased item (required by the platform)
2121
+ */
2122
+ async purchaseComplete(itemName) {
2123
+ return this.sendTelemetry("game", "purchase", "complete", null, null, {
2124
+ item_name: itemName
2125
+ });
2126
+ }
2127
+ /**
2128
+ * Required lifecycle telemetry — Purchase failed.
2129
+ * @param itemName Name of the item the purchase was for
2130
+ */
2131
+ async purchaseFail(itemName) {
2132
+ return this.sendTelemetry("game", "purchase", "fail", null, null, {
2133
+ item_name: itemName
2134
+ });
2135
+ }
2136
+ /**
2137
+ * Required lifecycle telemetry — Purchase cancelled.
2138
+ * @param itemName Name of the item the purchase was for
2139
+ */
2140
+ async purchaseCancel(itemName) {
2141
+ return this.sendTelemetry("game", "purchase", "cancel", null, null, {
2142
+ item_name: itemName
2143
+ });
2144
+ }
2058
2145
  /**
2059
2146
  * Makes an authenticated API call using the JWT token
2060
2147
  * @param endpoint API endpoint path (will be appended to base URL)
@@ -2394,14 +2481,15 @@ var HyveClient = class {
2394
2481
  return this.adsService.show(type);
2395
2482
  }
2396
2483
  /**
2397
- * Notifies CrazyGames that gameplay has started.
2398
- * No-op on other platforms.
2484
+ * Required lifecycle telemetry Gameplay start.
2485
+ * Also notifies CrazyGames that gameplay has started.
2399
2486
  */
2400
2487
  async gameplayStart() {
2401
2488
  if (this.crazyGamesService) {
2402
2489
  if (this.crazyGamesInitPromise) await this.crazyGamesInitPromise;
2403
2490
  this.crazyGamesService.gameplayStart();
2404
2491
  }
2492
+ return this.sendTelemetry("game", "gameplay", "start");
2405
2493
  }
2406
2494
  /**
2407
2495
  * Notifies CrazyGames that gameplay has stopped.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyve-sdk/js",
3
- "version": "2.11.2",
3
+ "version": "2.12.0",
4
4
  "description": "Hyve SDK - TypeScript wrapper for Hyve game server integration",
5
5
  "private": false,
6
6
  "publishConfig": {