@hyve-sdk/js 2.14.0-canary.2 → 2.14.0-canary.3
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 +8 -4
- package/dist/index.d.ts +8 -4
- package/dist/index.js +15 -9
- package/dist/index.mjs +15 -9
- package/dist/react.d.mts +8 -4
- package/dist/react.d.ts +8 -4
- package/dist/react.js +15 -9
- package/dist/react.mjs +15 -9
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -734,12 +734,16 @@ declare class HyveClient {
|
|
|
734
734
|
*/
|
|
735
735
|
reset(): void;
|
|
736
736
|
/**
|
|
737
|
-
* Get the storage adapter based on mode.
|
|
737
|
+
* Get the storage adapter based on platform and mode.
|
|
738
738
|
*
|
|
739
739
|
* Selection order:
|
|
740
|
-
* 1.
|
|
741
|
-
*
|
|
742
|
-
*
|
|
740
|
+
* 1. On the CrazyGames platform, the CrazyGames data store is ALWAYS used —
|
|
741
|
+
* 'cloud'/'local' are durability intents and the CrazyGames store
|
|
742
|
+
* satisfies both (account-synced when logged in, device-local for
|
|
743
|
+
* guests). This keeps games portable: per-call modes written for
|
|
744
|
+
* hyve.gg need no changes on CrazyGames, where the cloud path cannot
|
|
745
|
+
* work anyway (no hyve JWT exists there).
|
|
746
|
+
* 2. Otherwise an explicit `mode` override ('cloud' | 'local') wins.
|
|
743
747
|
* 3. Otherwise the configured storageMode is used.
|
|
744
748
|
*
|
|
745
749
|
* Awaits CrazyGames SDK initialization so the data store is ready before use.
|
package/dist/index.d.ts
CHANGED
|
@@ -734,12 +734,16 @@ declare class HyveClient {
|
|
|
734
734
|
*/
|
|
735
735
|
reset(): void;
|
|
736
736
|
/**
|
|
737
|
-
* Get the storage adapter based on mode.
|
|
737
|
+
* Get the storage adapter based on platform and mode.
|
|
738
738
|
*
|
|
739
739
|
* Selection order:
|
|
740
|
-
* 1.
|
|
741
|
-
*
|
|
742
|
-
*
|
|
740
|
+
* 1. On the CrazyGames platform, the CrazyGames data store is ALWAYS used —
|
|
741
|
+
* 'cloud'/'local' are durability intents and the CrazyGames store
|
|
742
|
+
* satisfies both (account-synced when logged in, device-local for
|
|
743
|
+
* guests). This keeps games portable: per-call modes written for
|
|
744
|
+
* hyve.gg need no changes on CrazyGames, where the cloud path cannot
|
|
745
|
+
* work anyway (no hyve JWT exists there).
|
|
746
|
+
* 2. Otherwise an explicit `mode` override ('cloud' | 'local') wins.
|
|
743
747
|
* 3. Otherwise the configured storageMode is used.
|
|
744
748
|
*
|
|
745
749
|
* Awaits CrazyGames SDK initialization so the data store is ready before use.
|
package/dist/index.js
CHANGED
|
@@ -2896,28 +2896,34 @@ var HyveClient = class {
|
|
|
2896
2896
|
logger.info("Client reset with new sessionId:", this.sessionId);
|
|
2897
2897
|
}
|
|
2898
2898
|
/**
|
|
2899
|
-
* Get the storage adapter based on mode.
|
|
2899
|
+
* Get the storage adapter based on platform and mode.
|
|
2900
2900
|
*
|
|
2901
2901
|
* Selection order:
|
|
2902
|
-
* 1.
|
|
2903
|
-
*
|
|
2904
|
-
*
|
|
2902
|
+
* 1. On the CrazyGames platform, the CrazyGames data store is ALWAYS used —
|
|
2903
|
+
* 'cloud'/'local' are durability intents and the CrazyGames store
|
|
2904
|
+
* satisfies both (account-synced when logged in, device-local for
|
|
2905
|
+
* guests). This keeps games portable: per-call modes written for
|
|
2906
|
+
* hyve.gg need no changes on CrazyGames, where the cloud path cannot
|
|
2907
|
+
* work anyway (no hyve JWT exists there).
|
|
2908
|
+
* 2. Otherwise an explicit `mode` override ('cloud' | 'local') wins.
|
|
2905
2909
|
* 3. Otherwise the configured storageMode is used.
|
|
2906
2910
|
*
|
|
2907
2911
|
* Awaits CrazyGames SDK initialization so the data store is ready before use.
|
|
2908
2912
|
* @param mode Storage mode override (cloud or local)
|
|
2909
2913
|
*/
|
|
2910
2914
|
async getStorageAdapter(mode) {
|
|
2911
|
-
if (mode) {
|
|
2912
|
-
return mode === "local" ? this.localStorageAdapter : this.cloudStorageAdapter;
|
|
2913
|
-
}
|
|
2914
2915
|
if (this.crazyGamesService && this.crazyGamesStorageAdapter) {
|
|
2915
2916
|
if (this.crazyGamesInitPromise) await this.crazyGamesInitPromise;
|
|
2916
|
-
|
|
2917
|
+
const env = this.crazyGamesService.getEnvironment();
|
|
2918
|
+
if (env === "crazygames" || env === "local") {
|
|
2919
|
+
if (mode) {
|
|
2920
|
+
logger.debug(`Storage mode '${mode}' ignored on CrazyGames \u2014 using the CrazyGames data store`);
|
|
2921
|
+
}
|
|
2917
2922
|
return this.crazyGamesStorageAdapter;
|
|
2918
2923
|
}
|
|
2919
2924
|
}
|
|
2920
|
-
|
|
2925
|
+
const selected = mode ?? this.storageMode;
|
|
2926
|
+
return selected === "local" ? this.localStorageAdapter : this.cloudStorageAdapter;
|
|
2921
2927
|
}
|
|
2922
2928
|
/**
|
|
2923
2929
|
* Returns the current game ID or throws if not available.
|
package/dist/index.mjs
CHANGED
|
@@ -2855,28 +2855,34 @@ var HyveClient = class {
|
|
|
2855
2855
|
logger.info("Client reset with new sessionId:", this.sessionId);
|
|
2856
2856
|
}
|
|
2857
2857
|
/**
|
|
2858
|
-
* Get the storage adapter based on mode.
|
|
2858
|
+
* Get the storage adapter based on platform and mode.
|
|
2859
2859
|
*
|
|
2860
2860
|
* Selection order:
|
|
2861
|
-
* 1.
|
|
2862
|
-
*
|
|
2863
|
-
*
|
|
2861
|
+
* 1. On the CrazyGames platform, the CrazyGames data store is ALWAYS used —
|
|
2862
|
+
* 'cloud'/'local' are durability intents and the CrazyGames store
|
|
2863
|
+
* satisfies both (account-synced when logged in, device-local for
|
|
2864
|
+
* guests). This keeps games portable: per-call modes written for
|
|
2865
|
+
* hyve.gg need no changes on CrazyGames, where the cloud path cannot
|
|
2866
|
+
* work anyway (no hyve JWT exists there).
|
|
2867
|
+
* 2. Otherwise an explicit `mode` override ('cloud' | 'local') wins.
|
|
2864
2868
|
* 3. Otherwise the configured storageMode is used.
|
|
2865
2869
|
*
|
|
2866
2870
|
* Awaits CrazyGames SDK initialization so the data store is ready before use.
|
|
2867
2871
|
* @param mode Storage mode override (cloud or local)
|
|
2868
2872
|
*/
|
|
2869
2873
|
async getStorageAdapter(mode) {
|
|
2870
|
-
if (mode) {
|
|
2871
|
-
return mode === "local" ? this.localStorageAdapter : this.cloudStorageAdapter;
|
|
2872
|
-
}
|
|
2873
2874
|
if (this.crazyGamesService && this.crazyGamesStorageAdapter) {
|
|
2874
2875
|
if (this.crazyGamesInitPromise) await this.crazyGamesInitPromise;
|
|
2875
|
-
|
|
2876
|
+
const env = this.crazyGamesService.getEnvironment();
|
|
2877
|
+
if (env === "crazygames" || env === "local") {
|
|
2878
|
+
if (mode) {
|
|
2879
|
+
logger.debug(`Storage mode '${mode}' ignored on CrazyGames \u2014 using the CrazyGames data store`);
|
|
2880
|
+
}
|
|
2876
2881
|
return this.crazyGamesStorageAdapter;
|
|
2877
2882
|
}
|
|
2878
2883
|
}
|
|
2879
|
-
|
|
2884
|
+
const selected = mode ?? this.storageMode;
|
|
2885
|
+
return selected === "local" ? this.localStorageAdapter : this.cloudStorageAdapter;
|
|
2880
2886
|
}
|
|
2881
2887
|
/**
|
|
2882
2888
|
* Returns the current game ID or throws if not available.
|
package/dist/react.d.mts
CHANGED
|
@@ -465,12 +465,16 @@ declare class HyveClient {
|
|
|
465
465
|
*/
|
|
466
466
|
reset(): void;
|
|
467
467
|
/**
|
|
468
|
-
* Get the storage adapter based on mode.
|
|
468
|
+
* Get the storage adapter based on platform and mode.
|
|
469
469
|
*
|
|
470
470
|
* Selection order:
|
|
471
|
-
* 1.
|
|
472
|
-
*
|
|
473
|
-
*
|
|
471
|
+
* 1. On the CrazyGames platform, the CrazyGames data store is ALWAYS used —
|
|
472
|
+
* 'cloud'/'local' are durability intents and the CrazyGames store
|
|
473
|
+
* satisfies both (account-synced when logged in, device-local for
|
|
474
|
+
* guests). This keeps games portable: per-call modes written for
|
|
475
|
+
* hyve.gg need no changes on CrazyGames, where the cloud path cannot
|
|
476
|
+
* work anyway (no hyve JWT exists there).
|
|
477
|
+
* 2. Otherwise an explicit `mode` override ('cloud' | 'local') wins.
|
|
474
478
|
* 3. Otherwise the configured storageMode is used.
|
|
475
479
|
*
|
|
476
480
|
* Awaits CrazyGames SDK initialization so the data store is ready before use.
|
package/dist/react.d.ts
CHANGED
|
@@ -465,12 +465,16 @@ declare class HyveClient {
|
|
|
465
465
|
*/
|
|
466
466
|
reset(): void;
|
|
467
467
|
/**
|
|
468
|
-
* Get the storage adapter based on mode.
|
|
468
|
+
* Get the storage adapter based on platform and mode.
|
|
469
469
|
*
|
|
470
470
|
* Selection order:
|
|
471
|
-
* 1.
|
|
472
|
-
*
|
|
473
|
-
*
|
|
471
|
+
* 1. On the CrazyGames platform, the CrazyGames data store is ALWAYS used —
|
|
472
|
+
* 'cloud'/'local' are durability intents and the CrazyGames store
|
|
473
|
+
* satisfies both (account-synced when logged in, device-local for
|
|
474
|
+
* guests). This keeps games portable: per-call modes written for
|
|
475
|
+
* hyve.gg need no changes on CrazyGames, where the cloud path cannot
|
|
476
|
+
* work anyway (no hyve JWT exists there).
|
|
477
|
+
* 2. Otherwise an explicit `mode` override ('cloud' | 'local') wins.
|
|
474
478
|
* 3. Otherwise the configured storageMode is used.
|
|
475
479
|
*
|
|
476
480
|
* Awaits CrazyGames SDK initialization so the data store is ready before use.
|
package/dist/react.js
CHANGED
|
@@ -2847,28 +2847,34 @@ var HyveClient = class {
|
|
|
2847
2847
|
logger.info("Client reset with new sessionId:", this.sessionId);
|
|
2848
2848
|
}
|
|
2849
2849
|
/**
|
|
2850
|
-
* Get the storage adapter based on mode.
|
|
2850
|
+
* Get the storage adapter based on platform and mode.
|
|
2851
2851
|
*
|
|
2852
2852
|
* Selection order:
|
|
2853
|
-
* 1.
|
|
2854
|
-
*
|
|
2855
|
-
*
|
|
2853
|
+
* 1. On the CrazyGames platform, the CrazyGames data store is ALWAYS used —
|
|
2854
|
+
* 'cloud'/'local' are durability intents and the CrazyGames store
|
|
2855
|
+
* satisfies both (account-synced when logged in, device-local for
|
|
2856
|
+
* guests). This keeps games portable: per-call modes written for
|
|
2857
|
+
* hyve.gg need no changes on CrazyGames, where the cloud path cannot
|
|
2858
|
+
* work anyway (no hyve JWT exists there).
|
|
2859
|
+
* 2. Otherwise an explicit `mode` override ('cloud' | 'local') wins.
|
|
2856
2860
|
* 3. Otherwise the configured storageMode is used.
|
|
2857
2861
|
*
|
|
2858
2862
|
* Awaits CrazyGames SDK initialization so the data store is ready before use.
|
|
2859
2863
|
* @param mode Storage mode override (cloud or local)
|
|
2860
2864
|
*/
|
|
2861
2865
|
async getStorageAdapter(mode) {
|
|
2862
|
-
if (mode) {
|
|
2863
|
-
return mode === "local" ? this.localStorageAdapter : this.cloudStorageAdapter;
|
|
2864
|
-
}
|
|
2865
2866
|
if (this.crazyGamesService && this.crazyGamesStorageAdapter) {
|
|
2866
2867
|
if (this.crazyGamesInitPromise) await this.crazyGamesInitPromise;
|
|
2867
|
-
|
|
2868
|
+
const env = this.crazyGamesService.getEnvironment();
|
|
2869
|
+
if (env === "crazygames" || env === "local") {
|
|
2870
|
+
if (mode) {
|
|
2871
|
+
logger.debug(`Storage mode '${mode}' ignored on CrazyGames \u2014 using the CrazyGames data store`);
|
|
2872
|
+
}
|
|
2868
2873
|
return this.crazyGamesStorageAdapter;
|
|
2869
2874
|
}
|
|
2870
2875
|
}
|
|
2871
|
-
|
|
2876
|
+
const selected = mode ?? this.storageMode;
|
|
2877
|
+
return selected === "local" ? this.localStorageAdapter : this.cloudStorageAdapter;
|
|
2872
2878
|
}
|
|
2873
2879
|
/**
|
|
2874
2880
|
* Returns the current game ID or throws if not available.
|
package/dist/react.mjs
CHANGED
|
@@ -2825,28 +2825,34 @@ var HyveClient = class {
|
|
|
2825
2825
|
logger.info("Client reset with new sessionId:", this.sessionId);
|
|
2826
2826
|
}
|
|
2827
2827
|
/**
|
|
2828
|
-
* Get the storage adapter based on mode.
|
|
2828
|
+
* Get the storage adapter based on platform and mode.
|
|
2829
2829
|
*
|
|
2830
2830
|
* Selection order:
|
|
2831
|
-
* 1.
|
|
2832
|
-
*
|
|
2833
|
-
*
|
|
2831
|
+
* 1. On the CrazyGames platform, the CrazyGames data store is ALWAYS used —
|
|
2832
|
+
* 'cloud'/'local' are durability intents and the CrazyGames store
|
|
2833
|
+
* satisfies both (account-synced when logged in, device-local for
|
|
2834
|
+
* guests). This keeps games portable: per-call modes written for
|
|
2835
|
+
* hyve.gg need no changes on CrazyGames, where the cloud path cannot
|
|
2836
|
+
* work anyway (no hyve JWT exists there).
|
|
2837
|
+
* 2. Otherwise an explicit `mode` override ('cloud' | 'local') wins.
|
|
2834
2838
|
* 3. Otherwise the configured storageMode is used.
|
|
2835
2839
|
*
|
|
2836
2840
|
* Awaits CrazyGames SDK initialization so the data store is ready before use.
|
|
2837
2841
|
* @param mode Storage mode override (cloud or local)
|
|
2838
2842
|
*/
|
|
2839
2843
|
async getStorageAdapter(mode) {
|
|
2840
|
-
if (mode) {
|
|
2841
|
-
return mode === "local" ? this.localStorageAdapter : this.cloudStorageAdapter;
|
|
2842
|
-
}
|
|
2843
2844
|
if (this.crazyGamesService && this.crazyGamesStorageAdapter) {
|
|
2844
2845
|
if (this.crazyGamesInitPromise) await this.crazyGamesInitPromise;
|
|
2845
|
-
|
|
2846
|
+
const env = this.crazyGamesService.getEnvironment();
|
|
2847
|
+
if (env === "crazygames" || env === "local") {
|
|
2848
|
+
if (mode) {
|
|
2849
|
+
logger.debug(`Storage mode '${mode}' ignored on CrazyGames \u2014 using the CrazyGames data store`);
|
|
2850
|
+
}
|
|
2846
2851
|
return this.crazyGamesStorageAdapter;
|
|
2847
2852
|
}
|
|
2848
2853
|
}
|
|
2849
|
-
|
|
2854
|
+
const selected = mode ?? this.storageMode;
|
|
2855
|
+
return selected === "local" ? this.localStorageAdapter : this.cloudStorageAdapter;
|
|
2850
2856
|
}
|
|
2851
2857
|
/**
|
|
2852
2858
|
* Returns the current game ID or throws if not available.
|