stream-connect-sdk 0.8.1 → 0.8.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,89 @@ 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.2
8
+
9
+ ### Fix: 2FA-required carriers no longer dead-end on a false "Connected"
10
+
11
+ A member connecting a carrier that requires two-factor auth could land on
12
+ a "Connected/finished" screen and never see the **verification-method
13
+ picker or code entry** — the connection then silently failed when the
14
+ carrier's 2FA prompt timed out unanswered. This happened with
15
+ `realTimeVerification: false`: the SDK fell straight to the end widget and
16
+ **never opened the progress stream**, so the `WAITING_FOR_METHOD_CHOICE`
17
+ event had nothing listening.
18
+
19
+ The fix keys the realtime/listening flow off the presence of a live
20
+ validation task (the `taskId` + `taskToken` the credential submit returns)
21
+ rather than off `realTimeVerification`. A live task means the backend is
22
+ running an async validation that **may** require 2FA, and a 2FA-pending
23
+ connection can never be "submit-and-trust" finished — the member has to
24
+ act. The validation hero (method picker / code entry) and the SSE runner
25
+ now mount whenever a validation is active, so 2FA is reachable even when
26
+ the verification UI was opted out of. A page reload mid-2FA also resumes
27
+ the live task now. First-time, never-submitted `realTimeVerification:
28
+ false` users see no change.
29
+
30
+ ### Patient Access API (OAuth) return is a toast, not a full-page stop
31
+
32
+ When a member finished connecting a carrier through its Patient Access
33
+ API (the OAuth redirect flow), they previously landed on a full-page
34
+ "Success!" end widget and had to click **"Add additional logins"** to
35
+ do anything else. That dead-end click is gone.
36
+
37
+ Both PAA variants now behave like the standard credential-submit flow:
38
+ on a successful connection the SDK drops a self-dismissing **"Connected"
39
+ card into the floating panel** and returns the member to the carrier
40
+ picker so they can immediately add another carrier. This applies to the
41
+ single-page redirect variant (which returns via
42
+ `?forceTPAStreamSdkEnd=1`) and the popup variant (which polls the interop
43
+ status). The single-page variant stashes the carrier name/logo across the
44
+ redirect so the toast can name it.
45
+
46
+ The explicit `forceEndStep` init option is unchanged — passing it still
47
+ routes straight to the end widget. Only the URL-driven PAA return changed.
48
+ When `realTimeVerification: false` (no floating panel), the PAA return
49
+ keeps the legacy end-widget behavior.
50
+
51
+ ### Policy-holder status view + gated credential editing
52
+
53
+ Tapping an already-connected carrier in the fix-credentials list now
54
+ opens a **status view** first instead of dropping straight into the
55
+ sign-in form. A healthy/connected carrier shows its connection status,
56
+ last-synced time, masked username, and a **claim-sync summary** (claims
57
+ synced + most recent claim date), and keeps the username/password hidden
58
+ behind an explicit **"Update sign-in info"** button. PAA carriers show a
59
+ **"Reconnect"** action instead. A carrier that genuinely needs attention
60
+ (bad creds, etc.) still opens straight into the fix form. Adding a brand
61
+ new carrier is unchanged.
62
+
63
+ The claim-sync summary is fed by two new fields on the policy-holder SDK
64
+ GET response (`claims_synced_count`, `most_recent_claim_date`); aggregate
65
+ audit signals only — no per-claim provider / amount / diagnosis.
66
+
67
+ ### Refuse to initialize on insecure (plain HTTP) host pages
68
+
69
+ `StreamConnect()` now checks `window.isSecureContext` at init and
70
+ refuses to mount the SDK if the host page is served over plain HTTP
71
+ from a non-loopback host. The browser-level secure-context check is
72
+ true on HTTPS and on the loopback hosts (`localhost`, `127.0.0.1`,
73
+ `[::1]`) — same set the new server-side CORS policy allows — so
74
+ local development against `vite`, `webpack-dev-server`, etc. is
75
+ unaffected.
76
+
77
+ The previous behavior on a plain-HTTP page was a generic
78
+ CORS-blocked error in the browser console on the first
79
+ `/sdk-api/*` request, with no actionable explanation. The SDK now
80
+ fails fast with a clear console error, calls the optional
81
+ `handleInitErrors` callback with the same message, and links to
82
+ the [origin-policy docs](https://developers.tpastream.com/connect/origin-policy)
83
+ explaining the requirement and how to fix it.
84
+
85
+ Members were never charged the network round-trip on a broken
86
+ plain-HTTP integration in the first place, so the practical effect
87
+ is shifting the error from "browser console mystery" to "init-time
88
+ diagnostic that names the problem."
89
+
7
90
  ## 0.8.1
8
91
 
9
92
  ### 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.2",
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",