@genex-ai/embed-sdk 0.28.0 → 0.29.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/README.md +11 -3
- package/dist/{chunk-WSJ5XPEF.js → chunk-SJLIF32C.js} +6 -3
- package/dist/index.js +1 -1
- package/dist/sentry.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,10 +8,17 @@ for identity and storage.
|
|
|
8
8
|
|
|
9
9
|
## Generate during play
|
|
10
10
|
|
|
11
|
-
Runtime generation requires a signed-in player in a
|
|
11
|
+
Runtime generation requires a signed-in player in a published game and an
|
|
12
12
|
enabled Genex runtime service. Each player approves their own payment on Genex.
|
|
13
13
|
The game never handles an OpenRouter key or confirms a charge itself.
|
|
14
14
|
|
|
15
|
+
**Test builds.** On the build `genex preview` ships, the game's OWNER can use
|
|
16
|
+
every call below before any player sees it: the same approval sheet (marked
|
|
17
|
+
"test build"), the same terms, billed to the owner's own credits or plan. Anyone
|
|
18
|
+
else signed in on a test build, and every guest on any build, is refused with
|
|
19
|
+
`player_wallet_required`; `waitForPlayer().guest` tells the two apart, and from
|
|
20
|
+
SDK 0.29.0 `generationErrorMessage('player_wallet_required')` names both.
|
|
21
|
+
|
|
15
22
|
```ts
|
|
16
23
|
import { generate, getGenerationModels } from '@genex-ai/embed-sdk';
|
|
17
24
|
|
|
@@ -196,8 +203,9 @@ The successful result carries `grantId` and the full server `grant` view.
|
|
|
196
203
|
|
|
197
204
|
`generate({ grantId })` runs one call under that budget. It opens **no window,
|
|
198
205
|
posts no parent message and needs no user gesture**, so it works from a game
|
|
199
|
-
loop or a timer. Every other guard is unchanged:
|
|
200
|
-
player, a trusted parent origin, and no
|
|
206
|
+
loop or a timer. Every other guard is unchanged: the published game (or its
|
|
207
|
+
owner on a test build), a signed-in player, a trusted parent origin, and no
|
|
208
|
+
native or local-test surface. The
|
|
201
209
|
funding door was chosen once in the sheet, so `allowExternal` is ignored on a
|
|
202
210
|
budget call. Every call is **billed as used on the budget**: its real model
|
|
203
211
|
cost plus the Genex fee accrues there, and the player's credits move one whole
|
|
@@ -804,8 +804,11 @@ function generationErrorMessage(code) {
|
|
|
804
804
|
case "no_player_session":
|
|
805
805
|
case "unauthorized":
|
|
806
806
|
case "guest_no_wallet":
|
|
807
|
-
case "player_wallet_required":
|
|
808
807
|
return "Sign in to Genex to use this.";
|
|
808
|
+
// ONE code for a guest anywhere and for anybody but the owner on a TEST
|
|
809
|
+
// build (`genex preview`), so the sentence has to be true for both.
|
|
810
|
+
case "player_wallet_required":
|
|
811
|
+
return "Sign in to Genex to use this. Only the game\u2019s owner can use this on a test build.";
|
|
809
812
|
case "session_revoked":
|
|
810
813
|
return "Your Genex session ended. Sign in again to continue.";
|
|
811
814
|
case "untrusted_parent":
|
|
@@ -818,7 +821,7 @@ function generationErrorMessage(code) {
|
|
|
818
821
|
case "local_test_unsupported":
|
|
819
822
|
return "In-game generation doesn\u2019t run in local test mode.";
|
|
820
823
|
case "staging_no_generation":
|
|
821
|
-
return "
|
|
824
|
+
return "Only the game\u2019s owner can use this on a test build.";
|
|
822
825
|
// --- quotes and terms ---------------------------------------------------
|
|
823
826
|
case "quote_expired":
|
|
824
827
|
case "generation_expired":
|
|
@@ -914,7 +917,7 @@ var RETRY_FLAG = "genex:embed:retry";
|
|
|
914
917
|
var POPOVER_DISMISSED_FLAG = "genex:guest:popover-dismissed";
|
|
915
918
|
var LOCAL_AUTH_FLAG = "genex:embed:local-auth";
|
|
916
919
|
var PLAYER_ID_KEY = "genex:player";
|
|
917
|
-
var SDK_VERSION = "0.
|
|
920
|
+
var SDK_VERSION = "0.29.0";
|
|
918
921
|
var config2 = null;
|
|
919
922
|
var state = "pending";
|
|
920
923
|
var user = null;
|
package/dist/index.js
CHANGED
package/dist/sentry.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genex-ai/embed-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0",
|
|
4
4
|
"description": "Player identity + durable game state for genex games \u2014 signed-in or guest play, per-player save slots, shared world state, and soft-trust leaderboards.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|