glitch-javascript-sdk 3.15.0 → 4.0.1
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 -0
- package/dist/browser/hosting-runtime.js +1 -1
- package/dist/browser/hosting-runtime.js.map +1 -1
- package/dist/cjs/index.js +7602 -52
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Microtransactions.d.ts +286 -39
- package/dist/esm/index.js +7643 -52
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/util/Requests.d.ts +3 -1
- package/dist/index.d.ts +290 -41
- package/guides/commerce-delivery-receiver.mjs +117 -0
- package/guides/microtransactions.md +258 -32
- package/package.json +3 -2
- package/src/api/Microtransactions.ts +252 -38
- package/src/routes/MicrotransactionsRoute.ts +11 -0
- package/src/util/MicrotransactionOverlay.ts +92 -27
- package/src/util/Requests.ts +2 -2
- package/src/util/Session.ts +3 -2
package/README.md
CHANGED
|
@@ -50,6 +50,7 @@ import Glitch from 'glitch-javascript-sdk';
|
|
|
50
50
|
Glitch.config.Config.setBaseUrl("https://api.glitch.local/api/", true);
|
|
51
51
|
|
|
52
52
|
//Set Auth JSON Web Token (if user has loggedin)
|
|
53
|
+
//Authenticated application context only, NOT a guest game checkout bundle.
|
|
53
54
|
Glitch.config.Config.setAuthToken("some-jwt");
|
|
54
55
|
|
|
55
56
|
//Make API Calls
|
|
@@ -71,3 +72,12 @@ Use `Glitch.api.Microtransactions` for title-scoped products, existing Media upl
|
|
|
71
72
|
game-branded hosted checkout, verified account handoff, inventory and refunds.
|
|
72
73
|
Read [the integration guide](guides/microtransactions.md) before handling purchases.
|
|
73
74
|
Never treat a browser message as payment proof or ship an administrative token.
|
|
75
|
+
For guest commerce configure only the API base URL in an isolated credential-free
|
|
76
|
+
SDK context: configured global auth is inherited even on guest entry. Existing
|
|
77
|
+
supported install-purpose runtime tokens remain valid only for their documented
|
|
78
|
+
install/validation/heartbeat/telemetry endpoints, never commerce authentication or
|
|
79
|
+
paid ownership. Do not inject them into guest commerce, remove the game's unrelated
|
|
80
|
+
allowed token, or change global SDK auth as a commerce workaround. SDK3.15.0
|
|
81
|
+
supports the player flow; SDK4 management is separate. The guide documents exact
|
|
82
|
+
hosted HTTPS versus local/testing origins, optional integration evidence, the
|
|
83
|
+
published-version compatibility tests and the SDK 4.0.1 follow-up.
|
|
@@ -5894,7 +5894,7 @@
|
|
|
5894
5894
|
// Prepare FormData
|
|
5895
5895
|
const formData = new FormData();
|
|
5896
5896
|
formData.append(filename, file);
|
|
5897
|
-
if (Requests.community_id) {
|
|
5897
|
+
if (Requests.community_id && !(options === null || options === void 0 ? void 0 : options.excludeCommunityContext)) {
|
|
5898
5898
|
data = Object.assign(Object.assign({}, data), { communities: [Requests.community_id] });
|
|
5899
5899
|
}
|
|
5900
5900
|
for (let key in data) {
|