@invonetwork/web-sdk 2.1.1 → 2.1.2

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
@@ -4,6 +4,18 @@ All notable changes to `@invonetwork/web-sdk` are documented here. This project
4
4
  [Semantic Versioning](https://semver.org/). Releases are managed with
5
5
  [changesets](https://github.com/changesets/changesets).
6
6
 
7
+ ## [2.1.2] — 2026-07-07
8
+
9
+ **Hosted-checkout reconciliation** (the create-session API contract is unchanged; the hosted
10
+ page was rebuilt). Additive + docs only.
11
+
12
+ - `createCheckout` now surfaces `expiresInSeconds` (the `checkout_url` token TTL, e.g. 900) as
13
+ a first-class field on `CreateCheckoutResult` — previously only on `.raw`.
14
+ - README: the `platform` rail is described as cards + Apple Pay / Google Pay / Link +
15
+ international billing (no app-store commission), and the checkout note now says reloading the
16
+ URL after a completed payment is idempotent (an already-complete success screen), not an
17
+ error. No API/signature changes.
18
+
7
19
  ## [2.1.1] — 2026-07-06
8
20
 
9
21
  **Security & correctness hardening** from a full audit + red-team of both SDKs. No API changes;
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  First-party TypeScript SDK for integrating **INVO** into partner **web** platforms (storefronts, web games, dashboards). It wraps INVO's web money flows behind a typed, versioned API — the web analog of the Unity/Unreal plugins.
4
4
 
5
- > **Status:** `v2.1.1` — stable, published on npm. The backend it wraps is **live** on sandbox + production. The API is covered by a [stability commitment](#stability): no breaking changes without a major bump. **Since 2.0.0 (breaking):** `mintPlayerToken` requires `playerPhone` (E.164) — see the [CHANGELOG](CHANGELOG.md) migration note. **2.1.0 adds** self-serve passkey recovery (`recoveryBegin`/`recoveryComplete`); **2.1.1** is a security/correctness hardening patch.
5
+ > **Status:** `v2.1.1` — stable, published on npm. The backend it wraps is **live** on sandbox + production. The API is covered by a [stability commitment](#stability): no breaking changes without a major bump. **Since 2.0.0 (breaking):** `mintPlayerToken` requires `playerPhone` (E.164) — see the [CHANGELOG](CHANGELOG.md) migration note. **2.1.0 adds** self-serve passkey recovery (`recoveryBegin`/`recoveryComplete`); **2.1.1** is a security/correctness hardening patch; **2.1.2** surfaces `expiresInSeconds` on `createCheckout`.
6
6
  > Canonical partner reference: **https://docs.invo.network/docs/currency-purchase** and **https://docs.invo.network/docs/game-developer-integration**.
7
7
 
8
8
  ## What it does
@@ -200,7 +200,7 @@ Buy game currency with real money. Authenticated by the **payment rail**, not a
200
200
 
201
201
  ```ts
202
202
  // SERVER
203
- const { checkoutUrl, sessionId, expiresAt } = await server.createCheckout({
203
+ const { checkoutUrl, sessionId, expiresAt, expiresInSeconds } = await server.createCheckout({
204
204
  playerEmail: "p@example.com",
205
205
  usdAmount: "20.00", // USD, 0 < x ≤ 999.99
206
206
  rail: "platform", // optional: "platform" (default) | "game" | "steam"
@@ -208,7 +208,9 @@ const { checkoutUrl, sessionId, expiresAt } = await server.createCheckout({
208
208
  cancelUrl: "https://you/buy/cancel",
209
209
  metadata: { yourOrderId: "ord_42" }, // echoed on the purchase.completed webhook (all rails); order_id also reconciles
210
210
  });
211
- // → send the browser to checkoutUrl (single-use, ~15 min)
211
+ // → send the browser to checkoutUrl. Token TTL is expiresInSeconds (~900s / 15 min).
212
+ // Reloading the URL after a completed payment is idempotent — it shows an already-complete
213
+ // success screen (no error), so you don't have to guard against a refresh.
212
214
  ```
213
215
 
214
216
  Open `checkoutUrl` either way:
@@ -237,8 +239,8 @@ The hosted page handles card entry, saved cards, and 3-D Secure (with a top-leve
237
239
  ### Payment rails (neutral names)
238
240
 
239
241
  The `rail` selects the in-page experience — all branded INVO, no visible redirect:
240
- - `"platform"` (default) — card checkout.
241
- - `"game"` — regional / game-store methods.
242
+ - `"platform"` (default) — cards plus **Apple Pay / Google Pay / Link** (rendered automatically on supported devices) and international billing addresses. It's a web checkout, so there's no app-store commission.
243
+ - `"game"` — regional / game-store methods (may redirect to the regional hosted page).
242
244
  - `"steam"` — Steam titles hand off to the in-client Steam flow.
243
245
 
244
246
  Provider/processor names are an internal detail and never appear in the API.
@@ -585,7 +587,7 @@ try {
585
587
  | `mintPlayerToken({ playerEmail, playerPhone })` | `{ token, expiresAt, identityId }` — **both required**; `playerPhone` must be E.164 (see [Player registration](#player-registration-email--phone-required)) |
586
588
  | `initiateSend(input)` | `{ transactionId, verificationMethod, guardianApproval?, raw }` |
587
589
  | `initiateTransfer(input)` | `{ transactionId, verificationMethod, guardianApproval?, raw }` |
588
- | `createCheckout(input)` | `{ sessionId, checkoutUrl, expiresAt, raw }` |
590
+ | `createCheckout(input)` | `{ sessionId, checkoutUrl, expiresAt, expiresInSeconds, raw }` |
589
591
  | `purchaseCurrency(input)` | `{ status, clientSecret?, paymentIntentId?, paymentUrl?, transactionId?, orderId?, newBalance?, raw }` |
590
592
  | `confirmPayment({ paymentIntentId, orderId? })` | `{ status, transactionId?, newBalance?, raw }` |
591
593
  | `getOrderDetails({ orderId? \| transactionId? })` | `{ order, financialSummary, statusTimeline, raw }` |
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as ClientConfig, a as CallOptions, A as ApproveResult, b as ConfirmReceiptResult, L as LinkDeviceResult, P as PendingCollectResult, D as DestinationsQuery, c as DestinationsResult, B as BalanceResult, E as EnrollmentBeginResult, d as EnrollmentVerifyResult, R as RecoveryBeginResult, e as RecoveryCompleteResult } from './types-DtihCpOj.cjs';
2
- export { f as BalanceRow, g as DestinationGame, I as InvoError, h as InvoErrorInfo, i as InvoHooks, j as InvoRequestInfo, k as InvoResponseInfo, l as PendingCollectItem, m as Rail, V as VerificationMethod } from './types-DtihCpOj.cjs';
1
+ import { C as ClientConfig, a as CallOptions, A as ApproveResult, b as ConfirmReceiptResult, L as LinkDeviceResult, P as PendingCollectResult, D as DestinationsQuery, c as DestinationsResult, B as BalanceResult, E as EnrollmentBeginResult, d as EnrollmentVerifyResult, R as RecoveryBeginResult, e as RecoveryCompleteResult } from './types-CU2BqbHN.cjs';
2
+ export { f as BalanceRow, g as DestinationGame, I as InvoError, h as InvoErrorInfo, i as InvoHooks, j as InvoRequestInfo, k as InvoResponseInfo, l as PendingCollectItem, m as Rail, V as VerificationMethod } from './types-CU2BqbHN.cjs';
3
3
 
4
4
  declare class InvoClient {
5
5
  private readonly http;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as ClientConfig, a as CallOptions, A as ApproveResult, b as ConfirmReceiptResult, L as LinkDeviceResult, P as PendingCollectResult, D as DestinationsQuery, c as DestinationsResult, B as BalanceResult, E as EnrollmentBeginResult, d as EnrollmentVerifyResult, R as RecoveryBeginResult, e as RecoveryCompleteResult } from './types-DtihCpOj.js';
2
- export { f as BalanceRow, g as DestinationGame, I as InvoError, h as InvoErrorInfo, i as InvoHooks, j as InvoRequestInfo, k as InvoResponseInfo, l as PendingCollectItem, m as Rail, V as VerificationMethod } from './types-DtihCpOj.js';
1
+ import { C as ClientConfig, a as CallOptions, A as ApproveResult, b as ConfirmReceiptResult, L as LinkDeviceResult, P as PendingCollectResult, D as DestinationsQuery, c as DestinationsResult, B as BalanceResult, E as EnrollmentBeginResult, d as EnrollmentVerifyResult, R as RecoveryBeginResult, e as RecoveryCompleteResult } from './types-CU2BqbHN.js';
2
+ export { f as BalanceRow, g as DestinationGame, I as InvoError, h as InvoErrorInfo, i as InvoHooks, j as InvoRequestInfo, k as InvoResponseInfo, l as PendingCollectItem, m as Rail, V as VerificationMethod } from './types-CU2BqbHN.js';
3
3
 
4
4
  declare class InvoClient {
5
5
  private readonly http;
package/dist/server.cjs CHANGED
@@ -528,7 +528,7 @@ async function hmacHexSubtle(secret, message) {
528
528
  }
529
529
 
530
530
  // src/server.ts
531
- var DEFAULT_UA = "invonetwork-web-sdk/2.1.1 (+https://invo.network)";
531
+ var DEFAULT_UA = "invonetwork-web-sdk/2.1.2 (+https://invo.network)";
532
532
  var MAX_USD_AMOUNT = 999.99;
533
533
  var MAX_ITEM_PRICE = 999999.99;
534
534
  function invalidInput(label, value, why) {
@@ -809,6 +809,7 @@ var InvoServer = class {
809
809
  sessionId: String(raw["session_id"] ?? ""),
810
810
  checkoutUrl: requireField(raw["checkout_url"], "checkout_url", raw),
811
811
  expiresAt: String(raw["expires_at"] ?? ""),
812
+ expiresInSeconds: Number(raw["expires_in_seconds"] ?? 0),
812
813
  raw
813
814
  };
814
815
  }
package/dist/server.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { I as InvoError, S as ServerConfig, a as CallOptions, n as PlayerToken, o as InitiateSendInput, p as InitiateResult, q as InitiateTransferInput, r as CreateCheckoutInput, s as CreateCheckoutResult, t as PurchaseInput, u as PurchaseResult, v as ConfirmPaymentResult, O as OrderDetailsResult, w as PurchaseItemInput, x as PurchaseItemResult, y as ItemHistoryQuery, z as ItemHistoryResult, F as ItemOrderQuery, G as PlayerBalanceQuery, H as PlayerBalanceResult, J as InboundPendingQuery, K as InboundPendingResult, M as LinkedIdentitiesQuery, N as LinkedIdentitiesResult, Q as SmsVerifyResult, T as ClaimTransferInput, U as ClaimResult, W as ClaimCurrencyInput, X as TransactionStatusResult, Y as GuardianApprovalStatusResult, Z as ServerDestinationsQuery, c as DestinationsResult, _ as PhoneShareContact, $ as PhoneShareInitiateResult, a0 as PhoneShareApproveInput, a1 as PhoneShareApproveResult, a2 as PhoneShareStatusResult } from './types-DtihCpOj.cjs';
2
- export { a3 as CurrencyBalance, g as DestinationGame, a4 as InboundPendingItem, h as InvoErrorInfo, i as InvoHooks, j as InvoRequestInfo, k as InvoResponseInfo, a5 as LinkedIdentityEmail, m as Rail, V as VerificationMethod } from './types-DtihCpOj.cjs';
1
+ import { I as InvoError, S as ServerConfig, a as CallOptions, n as PlayerToken, o as InitiateSendInput, p as InitiateResult, q as InitiateTransferInput, r as CreateCheckoutInput, s as CreateCheckoutResult, t as PurchaseInput, u as PurchaseResult, v as ConfirmPaymentResult, O as OrderDetailsResult, w as PurchaseItemInput, x as PurchaseItemResult, y as ItemHistoryQuery, z as ItemHistoryResult, F as ItemOrderQuery, G as PlayerBalanceQuery, H as PlayerBalanceResult, J as InboundPendingQuery, K as InboundPendingResult, M as LinkedIdentitiesQuery, N as LinkedIdentitiesResult, Q as SmsVerifyResult, T as ClaimTransferInput, U as ClaimResult, W as ClaimCurrencyInput, X as TransactionStatusResult, Y as GuardianApprovalStatusResult, Z as ServerDestinationsQuery, c as DestinationsResult, _ as PhoneShareContact, $ as PhoneShareInitiateResult, a0 as PhoneShareApproveInput, a1 as PhoneShareApproveResult, a2 as PhoneShareStatusResult } from './types-CU2BqbHN.cjs';
2
+ export { a3 as CurrencyBalance, g as DestinationGame, a4 as InboundPendingItem, h as InvoErrorInfo, i as InvoHooks, j as InvoRequestInfo, k as InvoResponseInfo, a5 as LinkedIdentityEmail, m as Rail, V as VerificationMethod } from './types-CU2BqbHN.cjs';
3
3
 
4
4
  interface VerifyWebhookOptions {
5
5
  /** Max age of the signed timestamp, in seconds. Default 300 (5 min). */
package/dist/server.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { I as InvoError, S as ServerConfig, a as CallOptions, n as PlayerToken, o as InitiateSendInput, p as InitiateResult, q as InitiateTransferInput, r as CreateCheckoutInput, s as CreateCheckoutResult, t as PurchaseInput, u as PurchaseResult, v as ConfirmPaymentResult, O as OrderDetailsResult, w as PurchaseItemInput, x as PurchaseItemResult, y as ItemHistoryQuery, z as ItemHistoryResult, F as ItemOrderQuery, G as PlayerBalanceQuery, H as PlayerBalanceResult, J as InboundPendingQuery, K as InboundPendingResult, M as LinkedIdentitiesQuery, N as LinkedIdentitiesResult, Q as SmsVerifyResult, T as ClaimTransferInput, U as ClaimResult, W as ClaimCurrencyInput, X as TransactionStatusResult, Y as GuardianApprovalStatusResult, Z as ServerDestinationsQuery, c as DestinationsResult, _ as PhoneShareContact, $ as PhoneShareInitiateResult, a0 as PhoneShareApproveInput, a1 as PhoneShareApproveResult, a2 as PhoneShareStatusResult } from './types-DtihCpOj.js';
2
- export { a3 as CurrencyBalance, g as DestinationGame, a4 as InboundPendingItem, h as InvoErrorInfo, i as InvoHooks, j as InvoRequestInfo, k as InvoResponseInfo, a5 as LinkedIdentityEmail, m as Rail, V as VerificationMethod } from './types-DtihCpOj.js';
1
+ import { I as InvoError, S as ServerConfig, a as CallOptions, n as PlayerToken, o as InitiateSendInput, p as InitiateResult, q as InitiateTransferInput, r as CreateCheckoutInput, s as CreateCheckoutResult, t as PurchaseInput, u as PurchaseResult, v as ConfirmPaymentResult, O as OrderDetailsResult, w as PurchaseItemInput, x as PurchaseItemResult, y as ItemHistoryQuery, z as ItemHistoryResult, F as ItemOrderQuery, G as PlayerBalanceQuery, H as PlayerBalanceResult, J as InboundPendingQuery, K as InboundPendingResult, M as LinkedIdentitiesQuery, N as LinkedIdentitiesResult, Q as SmsVerifyResult, T as ClaimTransferInput, U as ClaimResult, W as ClaimCurrencyInput, X as TransactionStatusResult, Y as GuardianApprovalStatusResult, Z as ServerDestinationsQuery, c as DestinationsResult, _ as PhoneShareContact, $ as PhoneShareInitiateResult, a0 as PhoneShareApproveInput, a1 as PhoneShareApproveResult, a2 as PhoneShareStatusResult } from './types-CU2BqbHN.js';
2
+ export { a3 as CurrencyBalance, g as DestinationGame, a4 as InboundPendingItem, h as InvoErrorInfo, i as InvoHooks, j as InvoRequestInfo, k as InvoResponseInfo, a5 as LinkedIdentityEmail, m as Rail, V as VerificationMethod } from './types-CU2BqbHN.js';
3
3
 
4
4
  interface VerifyWebhookOptions {
5
5
  /** Max age of the signed timestamp, in seconds. Default 300 (5 min). */
package/dist/server.js CHANGED
@@ -167,7 +167,7 @@ async function hmacHexSubtle(secret, message) {
167
167
  }
168
168
 
169
169
  // src/server.ts
170
- var DEFAULT_UA = "invonetwork-web-sdk/2.1.1 (+https://invo.network)";
170
+ var DEFAULT_UA = "invonetwork-web-sdk/2.1.2 (+https://invo.network)";
171
171
  var MAX_USD_AMOUNT = 999.99;
172
172
  var MAX_ITEM_PRICE = 999999.99;
173
173
  function invalidInput(label, value, why) {
@@ -448,6 +448,7 @@ var InvoServer = class {
448
448
  sessionId: String(raw["session_id"] ?? ""),
449
449
  checkoutUrl: requireField(raw["checkout_url"], "checkout_url", raw),
450
450
  expiresAt: String(raw["expires_at"] ?? ""),
451
+ expiresInSeconds: Number(raw["expires_in_seconds"] ?? 0),
451
452
  raw
452
453
  };
453
454
  }
@@ -198,6 +198,8 @@ interface CreateCheckoutResult {
198
198
  /** Send the browser here; INVO's hosted page handles the processor + 3-D Secure. */
199
199
  checkoutUrl: string;
200
200
  expiresAt: string;
201
+ /** The `checkout_url` token TTL in seconds (e.g. 900 = 15 min). 0 if the backend omits it. */
202
+ expiresInSeconds: number;
201
203
  raw: Record<string, unknown>;
202
204
  }
203
205
  interface PurchaseInput {
@@ -198,6 +198,8 @@ interface CreateCheckoutResult {
198
198
  /** Send the browser here; INVO's hosted page handles the processor + 3-D Secure. */
199
199
  checkoutUrl: string;
200
200
  expiresAt: string;
201
+ /** The `checkout_url` token TTL in seconds (e.g. 900 = 15 min). 0 if the backend omits it. */
202
+ expiresInSeconds: number;
201
203
  raw: Record<string, unknown>;
202
204
  }
203
205
  interface PurchaseInput {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@invonetwork/web-sdk",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "description": "INVO Web SDK — currency purchase + passkey (WebAuthn) verification for partner web platforms.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "private": false,