stream-connect-sdk 0.8.1 → 0.8.3

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,119 @@ All notable changes to the `stream-connect-sdk` npm package. The
4
4
  companion React Native hook (`stream-connect-sdk-hook`) is on its own
5
5
  release line; see [`sdk-hook/docs/README.md`](./sdk-hook/docs/README.md).
6
6
 
7
+ ## 0.8.3
8
+
9
+ ### Fix: carriers that ask for Date of Birth could never be connected
10
+
11
+ A member connecting a carrier whose credential form includes a **Date of
12
+ Birth** field — Medical Mutual and SimplePay Health — could not complete
13
+ enrollment. Whatever they typed was discarded before the request left the
14
+ browser, the backend rejected the submission as missing a required field
15
+ (HTTP 422), and the form came back with a red validation error. No input
16
+ format worked, because the value never reached the server at all.
17
+
18
+ The credential payload spread the carrier's form values first and then
19
+ re-pinned a handful of SDK-controlled fields on top. One of those was
20
+ `date_of_birth: values.dateOfBirth || null` — camelCase, which no carrier
21
+ schema emits — so it always evaluated to `null` and overwrote the real
22
+ value. The line was inherited from 0.7.x, where the spread order was
23
+ reversed and the member's value won; 0.8.0 inverted that order (so carrier
24
+ schemas can't clobber `payer_id` / `accept` / `tenants_accept`) and turned a
25
+ dead line into a data-destroying one. The re-pin is gone; `payer_id` and the
26
+ consent fields are still protected.
27
+
28
+ Date fields also render as a native date input now. Carrier schemas mark
29
+ them `{"type": "string", "format": "date"}`, which 0.8.x rendered as a bare
30
+ text box with no format hint even though the backend only accepts ISO
31
+ `YYYY-MM-DD`. The date input always produces ISO, so there is nothing left
32
+ to guess.
33
+
34
+ The React Native hook (`stream-connect-sdk-hook`) kept the 0.7.x spread
35
+ order and was never affected.
36
+
37
+ ## 0.8.2
38
+
39
+ ### Fix: 2FA-required carriers no longer dead-end on a false "Connected"
40
+
41
+ A member connecting a carrier that requires two-factor auth could land on
42
+ a "Connected/finished" screen and never see the **verification-method
43
+ picker or code entry** — the connection then silently failed when the
44
+ carrier's 2FA prompt timed out unanswered. This happened with
45
+ `realTimeVerification: false`: the SDK fell straight to the end widget and
46
+ **never opened the progress stream**, so the `WAITING_FOR_METHOD_CHOICE`
47
+ event had nothing listening.
48
+
49
+ The fix keys the realtime/listening flow off the presence of a live
50
+ validation task (the `taskId` + `taskToken` the credential submit returns)
51
+ rather than off `realTimeVerification`. A live task means the backend is
52
+ running an async validation that **may** require 2FA, and a 2FA-pending
53
+ connection can never be "submit-and-trust" finished — the member has to
54
+ act. The validation hero (method picker / code entry) and the SSE runner
55
+ now mount whenever a validation is active, so 2FA is reachable even when
56
+ the verification UI was opted out of. A page reload mid-2FA also resumes
57
+ the live task now. First-time, never-submitted `realTimeVerification:
58
+ false` users see no change.
59
+
60
+ ### Patient Access API (OAuth) return is a toast, not a full-page stop
61
+
62
+ When a member finished connecting a carrier through its Patient Access
63
+ API (the OAuth redirect flow), they previously landed on a full-page
64
+ "Success!" end widget and had to click **"Add additional logins"** to
65
+ do anything else. That dead-end click is gone.
66
+
67
+ Both PAA variants now behave like the standard credential-submit flow:
68
+ on a successful connection the SDK drops a self-dismissing **"Connected"
69
+ card into the floating panel** and returns the member to the carrier
70
+ picker so they can immediately add another carrier. This applies to the
71
+ single-page redirect variant (which returns via
72
+ `?forceTPAStreamSdkEnd=1`) and the popup variant (which polls the interop
73
+ status). The single-page variant stashes the carrier name/logo across the
74
+ redirect so the toast can name it.
75
+
76
+ The explicit `forceEndStep` init option is unchanged — passing it still
77
+ routes straight to the end widget. Only the URL-driven PAA return changed.
78
+ When `realTimeVerification: false` (no floating panel), the PAA return
79
+ keeps the legacy end-widget behavior.
80
+
81
+ ### Policy-holder status view + gated credential editing
82
+
83
+ Tapping an already-connected carrier in the fix-credentials list now
84
+ opens a **status view** first instead of dropping straight into the
85
+ sign-in form. A healthy/connected carrier shows its connection status,
86
+ last-synced time, masked username, and a **claim-sync summary** (claims
87
+ synced + most recent claim date), and keeps the username/password hidden
88
+ behind an explicit **"Update sign-in info"** button. PAA carriers show a
89
+ **"Reconnect"** action instead. A carrier that genuinely needs attention
90
+ (bad creds, etc.) still opens straight into the fix form. Adding a brand
91
+ new carrier is unchanged.
92
+
93
+ The claim-sync summary is fed by two new fields on the policy-holder SDK
94
+ GET response (`claims_synced_count`, `most_recent_claim_date`); aggregate
95
+ audit signals only — no per-claim provider / amount / diagnosis.
96
+
97
+ ### Refuse to initialize on insecure (plain HTTP) host pages
98
+
99
+ `StreamConnect()` now checks `window.isSecureContext` at init and
100
+ refuses to mount the SDK if the host page is served over plain HTTP
101
+ from a non-loopback host. The browser-level secure-context check is
102
+ true on HTTPS and on the loopback hosts (`localhost`, `127.0.0.1`,
103
+ `[::1]`) — same set the new server-side CORS policy allows — so
104
+ local development against `vite`, `webpack-dev-server`, etc. is
105
+ unaffected.
106
+
107
+ The previous behavior on a plain-HTTP page was a generic
108
+ CORS-blocked error in the browser console on the first
109
+ `/sdk-api/*` request, with no actionable explanation. The SDK now
110
+ fails fast with a clear console error, calls the optional
111
+ `handleInitErrors` callback with the same message, and links to
112
+ the [origin-policy docs](https://developers.tpastream.com/connect/origin-policy)
113
+ explaining the requirement and how to fix it.
114
+
115
+ Members were never charged the network round-trip on a broken
116
+ plain-HTTP integration in the first place, so the practical effect
117
+ is shifting the error from "browser console mystery" to "init-time
118
+ diagnostic that names the problem."
119
+
7
120
  ## 0.8.1
8
121
 
9
122
  ### Handle expired connectAccessToken without a confusing error
@@ -194,7 +194,7 @@ Don't set these in production code.
194
194
  When the Patient Access API flow returns the user from a carrier site back to the page hosting the SDK, the redirect URL can carry two query parameters that the 0.8 SDK reads automatically on init:
195
195
 
196
196
  * **`?accessToken=...`**: a fresh connect-access token minted by `app.tpastream.com` after the carrier redirect completes. The SDK reads it on load, uses it for the remainder of the session, and (regardless of whether `connectAccessToken` was already set in the init object) takes the URL value as the freshest. The token is single-use.
197
- * **`?forceTPAStreamSdkEnd=1`**: set by the redirect URL the SDK constructs when `enablePatientAccessAPISinglePage` is `true`. Tells this load to skip straight to the end widget instead of restarting at choose-payer.
197
+ * **`?forceTPAStreamSdkEnd=1`**: set by the redirect URL the SDK constructs when `enablePatientAccessAPISinglePage` is `true`. Flags the OAuth return. As of 0.8.2 the SDK surfaces a self-dismissing "Connected" toast in the floating panel and lands the member on the carrier picker so they can add another carrier — it no longer forces the full-page end widget. (With `realTimeVerification: false` there's no panel, so it falls back to the end widget.) The explicit `forceEndStep` init option below is unaffected.
198
198
 
199
199
  Both parameters are stripped from the URL via `history.replaceState` after the SDK reads them. `replaceState` (not `pushState`) is used deliberately: the back button cannot restore the original URL, so the single-use access token cannot leak via history navigation or browser autofill.
200
200
 
package/docs/interop.md CHANGED
@@ -24,7 +24,7 @@ The legacy alias `enableInteropSinglePage` is also still accepted with the same
24
24
  After the carrier redirect completes, the SDK reads two URL parameters automatically on load:
25
25
 
26
26
  * `?accessToken=...`: a fresh connect-access token minted by `app.tpastream.com`.
27
- * `?forceTPAStreamSdkEnd=1`: set in the single-page variant to tell the next load to skip straight to the end widget.
27
+ * `?forceTPAStreamSdkEnd=1`: set in the single-page variant to flag the OAuth return. As of 0.8.2 the SDK shows a self-dismissing "Connected" toast in the floating panel and returns the member to the carrier picker (so they can add another carrier) rather than the full-page end widget. When `realTimeVerification: false` (no panel), it falls back to the end widget. The explicit `forceEndStep` init option is unaffected and still routes to the end widget.
28
28
 
29
29
  Both are stripped from the URL via `history.replaceState` so they cannot leak via browser history or autofill. See [Client Usage > Redirect query parameters](./client-usage.md#redirect-query-parameters-patient-access-api) for the full mechanics.
30
30
 
@@ -91,6 +91,12 @@ If you deliberately want the legacy fallthrough behavior — e.g. you're doing c
91
91
 
92
92
  If you use `renderChoosePayer={false}` / `renderPayerForm={false}` / `renderEndWidget={false}` and drive those steps from `doneChoosePayer` / `doneCreatedForm` / `doneEasyEnroll`, the data passed into your callbacks is unchanged.
93
93
 
94
+ ### 9. Host page must be HTTPS (0.8.2)
95
+
96
+ Starting in 0.8.2, `StreamConnect()` refuses to mount if the host page is served over plain `http://` from a non-loopback host. `localhost`, `127.0.0.1`, and `[::1]` are still allowed so local development is unaffected. Staging or internal hostnames served over plain HTTP are not.
97
+
98
+ If you embed the SDK in a member-facing page that's currently on plain HTTP, that page must move to HTTPS before 0.8.x will mount. See the [Origin Policy doc](https://developers.tpastream.com/connect/origin-policy) for the full rules, the exact console error developers will see, and how to fix it.
99
+
94
100
  ## What you do NOT need to do
95
101
 
96
102
  - You do not need to add a `theme` option. The default appearance applies automatically.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stream-connect-sdk",
3
- "version": "0.8.1",
3
+ "version": "0.8.3",
4
4
  "description": "A JavaScript SDK implementing TPAStream's Connect Platform",
5
5
  "scripts": {
6
6
  "build": "webpack --config webpack.prod-sdk.js --mode=production",