@invonetwork/web-sdk 3.32.0 → 3.34.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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.34.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Key prefixes name the environment. New keys are `ivsdk_live_...` (production) and `ivsdk_test_...` (sandbox). `resolveEnvironment`, `baseUrlForKey` and `invoGameServerFromEnv` pick the environment from the prefix with no network call, as they already did for the demo key. Older `ivsdk_...` keys keep working and are still looked up with `GET /api/sdk/key-environment`, exactly as before.
8
+ - New `environmentFromKeyPrefix(key)`: `"production"`, `"sandbox"` or `null` (an unprefixed key). Also exported: `environmentForBaseUrl(url)`, `LIVE_KEY_PREFIX`, `TEST_KEY_PREFIX` and `KeyEnvironmentMismatchError`.
9
+ - A live or test key paired with the other INVO host now throws `KeyEnvironmentMismatchError` at construction, before any request: `new InvoServer({ gameSecret, baseUrl })`, and `invoGameServerFromEnv` with `INVO_BASE_URL` or an `INVO_ENV` that disagrees with the key. A base URL that is not an INVO host (your own proxy) is never checked, and unprefixed and demo keys are never checked.
10
+ - `InvoError.isKeyForOtherEnvironment` for `KEY_FOR_OTHER_ENVIRONMENT` (401): the key belongs to the other environment. Not retried.
11
+ - Webhook signing secrets made from now on start with `whsec_live_` or `whsec_test_`. Nothing changes: the whole secret is the signing key, as before.
12
+
13
+ ## 3.33.0
14
+
15
+ ### Minor Changes
16
+
17
+ - Platform Commerce: buyer-approved balance purchases. `purchase({ requirePlayerApproval: true, returnUrl })` returns `status: "pending_approval"` with `approvalId` and `approvalUrl`; nothing is debited until the buyer approves on INVO's page. New `getApproval({ approvalId | clientRequestId })` and `cancelApproval(approvalId)` (`PlatformApprovalResult`), and error helpers `isBalanceUnavailable`, `isApprovalNotAvailable`, `isApprovalNotFound`, `isApprovalAlreadyEnded`. Webhooks: `platform_commerce.declined` (opt-in, never delivered through `*`); `metadata` on `platform_commerce.purchased` and `platform_commerce.refunded` (both legs). All additive.
18
+
3
19
  ## 3.32.0
4
20
 
5
21
  ### Minor Changes