@ai4b-team/fsaos-gateway-sdk 3.18.0 → 3.19.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
@@ -49,6 +49,25 @@ Rule of thumb: if the answer should differ depending on *who is asking* or *whic
49
49
  ### Gateway Call
50
50
  - `gatewayCall(method, params)` — Core RPC dispatcher: `POST /d/{hostname}`
51
51
 
52
+ ### Public Page Forms
53
+ - `submitForm(capabilityId, fields, options?)` — Submit through the public domain gateway to the form dataset bound to the current published page release. The browser supplies only the declared capability name, current page URL, and field values; it never receives a dataset identity or write credential. This works from the IIFE, ESM, or npm build.
54
+ - `FormSubmissionError` — Includes the stable `fillId`, HTTP status, and error code so an uncertain submission can be retried without creating a second fill.
55
+
56
+ ```ts
57
+ const receipt = await submitForm('hero-optin', { email });
58
+ if (receipt.next) window.location.assign(receipt.next);
59
+ ```
60
+
61
+ Plain HTML can use the same contract without loading the SDK:
62
+
63
+ ```html
64
+ <form method="post" action="https://fsaos-mcp-gw-rust.fly.dev/d/launch.example.com/actions/hero-optin">
65
+ <input type="hidden" name="_page_path" value="/offer">
66
+ <input type="email" name="email" required>
67
+ <button type="submit">Continue</button>
68
+ </form>
69
+ ```
70
+
52
71
  ### Shared Instances
53
72
  - `supabase` — Shared Supabase client instance
54
73
  - `queryClient` — Shared TanStack QueryClient instance