@ai4b-team/fsaos-gateway-sdk 5.6.2 → 5.7.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 CHANGED
@@ -74,6 +74,32 @@ Plain HTML can use the same contract without loading the SDK:
74
74
  </form>
75
75
  ```
76
76
 
77
+ ### Funnel file purchases
78
+
79
+ Published RevDev pages declare a `commerce.checkout` capability pointing to an
80
+ active file offer. Bind that action on a funnel page step and connect its
81
+ `purchase.ready` event to the next page. Publish the project before accepting
82
+ purchases. The server freezes the selected funnel, offer and next page on each
83
+ purchase; URL parameters cannot choose a price, seller connection or redirect.
84
+
85
+ For a public page, send the buyer to the host app for authentication and Space
86
+ selection with `funnelCheckoutLink`. Supply the host where this offer is sold:
87
+
88
+ ```ts
89
+ const href = funnelCheckoutLink({
90
+ hostOrigin: 'https://app.example.com', productId,
91
+ capabilityId: 'buy', pageUrl: window.location.href,
92
+ });
93
+ ```
94
+
95
+ A signed-in RevDev app can instead call `startFileCheckout` with the product
96
+ revision returned by `commerce-file-sale` action `offer`, an authorized
97
+ destination Space, a stable request key and its current published page/action.
98
+ Use `getFilePurchase` once on return and on the existing SDK item event; do not
99
+ poll. `filePurchaseNextUrl(receipt)` returns the saved next URL only after
100
+ verified payment and file delivery. Fulfillment happens on the server even if
101
+ the buyer closes the page. This API does not grant edit/resale rights.
102
+
77
103
  ### Shared Instances
78
104
  - `supabase` — Shared Supabase client instance
79
105
  - `queryClient` — Shared TanStack QueryClient instance