stream-connect-sdk 0.8.3 → 0.8.5

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,76 @@ 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.5
8
+
9
+ ### Broken logins surface on the entry screen (TPA-6662)
10
+
11
+ A member opening the widget in member-portal mode saw no signal that
12
+ any of their carrier logins were broken until they clicked into
13
+ "Manage your carriers", so broken logins sat unnoticed exactly where
14
+ the member already was. The entry screen's Manage tile now carries a
15
+ pill reading "X logins need attention", where X is the combined
16
+ critical + warning count from the same `severityFor` classification
17
+ the carrier list uses (a warning with a successful sync in the last
18
+ seven days still counts as healthy). The pill is red if any critical
19
+ problem exists, amber otherwise, and renders nothing at zero. The
20
+ count is computed from the policy holders already in widget state, so
21
+ it costs no extra request, and because the widget refetches member
22
+ state after each validation completes, fixing a login updates the
23
+ count without a reload.
24
+
25
+ ### The widget reports the page it is mounted on (TPA-6661)
26
+
27
+ Cross-origin requests carry only the embedding page's origin; the path
28
+ never reaches the server. The SDK now sends the hosting page's
29
+ pathname as `X-SDK-Page-Path` on every request, and the backend stamps
30
+ (origin, path) per SDK token and tenant. That stamped location is what
31
+ lets fix-credentials emails link members of SDK-only tenants back to
32
+ the portal page that actually hosts the widget instead of a TPA Stream
33
+ portal they have never seen. Older backends ignore the header.
34
+
35
+ ## 0.8.4
36
+
37
+ ### Validations that outlive one stream connection keep reporting live
38
+
39
+ A member whose credential validation ran longer than a single progress
40
+ stream would watch live updates stop arriving, get "Still working on
41
+ it", and have no way forward except reloading the page. Nothing was
42
+ broken server-side: the SDK had simply stopped looking.
43
+
44
+ The server caps one SSE connection at about ten minutes
45
+ (`STREAM_DEADLINE_SECONDS`) and then emits a `timeout` event. That
46
+ deadline belongs to the connection, not to the validation:
47
+ `validate_credentials` runs up to 4800s, and the slow part is usually
48
+ the post-MFA claims pull, well after the member has done everything
49
+ asked of them. The runner treated `timeout` as the end of the story.
50
+
51
+ It now reattaches. On `timeout` it re-fetches the policy holder, takes
52
+ the still-active `task_id` and a freshly minted `task_token`, and
53
+ resubscribes: the same loop the Connect API docs describe for backend
54
+ callers. Up to ten reattaches, which spans the ~90-minute window the
55
+ backend keeps a validation observable for. Dropped connections take the
56
+ same path behind a 1s-to-15s backoff, so an SSE blip doesn't become a
57
+ retry storm across every member mid-validation.
58
+
59
+ When a reattach finds no active task the validation has almost
60
+ certainly finished, but that is not a good enough basis for telling a
61
+ member their carrier connected: the real outcome comes from the
62
+ validate-credentials GET, and only a terminal state finalizes.
63
+ `pending_async` remains the fallback for an unreachable backend or a
64
+ spent attempt budget.
65
+
66
+ Requires a backend that serves `task_id` + `task_token` on the
67
+ policy-holder GET (stream #15091, live 2026-07-29). Against an older
68
+ backend the reattach finds no token and the SDK falls back to the
69
+ previous `pending_async` behavior.
70
+
71
+ Verified end to end against a local stack with the per-connection
72
+ deadline shortened to 15s, driving the built-in test-2FA carrier: nine
73
+ connections, a distinct token on each, every reattach 15.3-15.4s apart,
74
+ and a `WAITING_FOR_TWO_FACTOR_CODE` emitted after a reattach rendering
75
+ live in the hero.
76
+
7
77
  ## 0.8.3
8
78
 
9
79
  ### Fix: carriers that ask for Date of Birth could never be connected
package/README.md CHANGED
@@ -4,6 +4,22 @@
4
4
 
5
5
  ## Version
6
6
 
7
+ ### 0.8.5
8
+
9
+ The entry screen's "Manage your carriers" tile now carries an "X logins need attention" pill (red if any critical problem exists, amber otherwise, hidden at zero), so members in portal mode see broken logins without clicking in. The SDK also reports the hosting page's pathname (`X-SDK-Page-Path`) so fix-credentials emails can route members of SDK-only tenants back to the portal page that embeds the widget.
10
+
11
+ ### 0.8.4
12
+
13
+ Credential validations that outlive a single progress stream now keep reporting live. A stream connection is capped at about ten minutes server-side; the SDK reattaches to the running validation instead of showing "Still working on it" and going quiet, so members on slow carriers or long MFA waits see the flow finish rather than having to reload.
14
+
15
+ ### 0.8.3
16
+
17
+ Fix: carriers whose credential form asks for a Date of Birth (Medical Mutual, SimplePay Health) could not be connected at all. The value was discarded before submit, so the server rejected the enrollment as missing a required field and no input format worked. Regression introduced in 0.8.0. Date fields now render as a native date input.
18
+
19
+ ### 0.8.2
20
+
21
+ Patient Access API (OAuth) connections finish with a self-dismissing "Connected" toast and return the member to the carrier picker instead of dead-ending on a full-page end widget. Tapping an already-connected carrier opens a status view first. Fix: 2FA-required carriers reach the verification-method picker rather than a false "Connected". `StreamConnect()` refuses to mount on insecure (plain-HTTP) host pages.
22
+
7
23
  ### 0.8.1
8
24
 
9
25
  Handle expired `connectAccessToken` cleanly. Long-lived pages no longer surface the misleading 422 when the ~60-minute server-side TTL elapses; integrations opt into transparent refresh via a new server-side endpoint hook, or a clean expiry callback as a fallback. See the [Refreshing an expired token](./docs/connect-access-token.md#refreshing-an-expired-token-081) integration guide.
@@ -21,6 +37,64 @@ This SDK embeds the [EasyEnrollment platform](https://www.easyenrollment.net) in
21
37
  Latest highlights below. The full per-version changelog lives in
22
38
  [CHANGELOG.md](./CHANGELOG.md).
23
39
 
40
+ ### 0.8.5 highlights
41
+
42
+ * "X logins need attention" pill on the entry screen's Manage tile:
43
+ combined critical + warning count from the same severity
44
+ classification the carrier list uses, red when any critical problem
45
+ exists, amber otherwise, absent at zero. Updates live as
46
+ validations complete, with no extra requests.
47
+ * The widget reports the page it is mounted on via `X-SDK-Page-Path`,
48
+ letting the backend stamp the embed location per SDK token and
49
+ tenant and route fix-credentials emails back to the hosting portal
50
+ page. Older backends ignore the header.
51
+
52
+ ### 0.8.4 highlights
53
+
54
+ * A validation that outlives one progress-stream connection keeps
55
+ streaming. The server caps a single SSE connection at roughly ten
56
+ minutes, but the validation behind it can run far longer: the
57
+ post-MFA claims pull is usually what takes the time. The SDK now
58
+ re-fetches the policy holder for a fresh stream token and
59
+ resubscribes, up to ten times, covering the validation's whole
60
+ observable lifetime.
61
+ * Members who used to dead-end on "Still working on it" until they
62
+ reloaded the page now watch the connection complete. `pending_async`
63
+ is still there, but only for when reattach genuinely can't proceed.
64
+ * Dropped connections take the same path behind a backoff, so an SSE
65
+ blip no longer ends a validation's live reporting.
66
+ * Requires the policy-holder GET to serve `task_id` + `task_token`
67
+ (stream #15091). Against an older backend the SDK falls back to the
68
+ previous `pending_async` behavior rather than failing.
69
+
70
+ ### 0.8.3 highlights
71
+
72
+ * Fix: a carrier whose credential form includes a **Date of Birth**
73
+ field — Medical Mutual, SimplePay Health — could not be connected.
74
+ Whatever the member typed was dropped before the request left the
75
+ browser, so the server rejected the enrollment as missing a required
76
+ field and returned a validation error no input format could clear.
77
+ Introduced in 0.8.0 by a spread-order change; ten weeks in the field.
78
+ * Date fields (`{"type": "string", "format": "date"}` in the carrier
79
+ schema) now render as a native date input rather than a bare text
80
+ box, so the submitted value is always the ISO `YYYY-MM-DD` the
81
+ backend expects.
82
+ * The React Native hook (`stream-connect-sdk-hook`) was never affected.
83
+
84
+ ### 0.8.2 highlights
85
+
86
+ * Patient Access API (OAuth) connections end with a self-dismissing
87
+ "Connected" toast in the floating panel and return the member to the
88
+ carrier picker, instead of dead-ending on a full-page end widget.
89
+ * Tapping an already-connected carrier opens a status view (status,
90
+ last-synced, masked username, claim-sync summary) with credentials
91
+ gated behind an explicit "Update sign-in info" / "Reconnect".
92
+ * Fix: 2FA-required carriers reach the verification-method picker
93
+ rather than a false "Connected" — the realtime flow keys off a live
94
+ validation task rather than `realTimeVerification`.
95
+ * `StreamConnect()` refuses to mount on insecure (plain-HTTP) host
96
+ pages; `localhost` / `127.0.0.1` / `[::1]` still work for local dev.
97
+
24
98
  ### 0.8.1 highlights
25
99
 
26
100
  * Handle expired `connectAccessToken` (the ~60-minute server-side
@@ -11,7 +11,7 @@ Mount the SDK by calling `StreamConnect({...})` with your config. The minimum yo
11
11
  ### Via CDN (vanilla HTML, server-rendered, Backbone, jQuery)
12
12
 
13
13
  ```html
14
- <script src="https://app.tpastream.com/static/js/sdk-v-0.8.1.js"></script>
14
+ <script src="https://app.tpastream.com/static/js/sdk-v-0.8.3.js"></script>
15
15
  <div id="sdk-hook"></div>
16
16
  <script>
17
17
  window.StreamConnect({
@@ -27,13 +27,17 @@ Mount the SDK by calling `StreamConnect({...})` with your config. The minimum yo
27
27
  </script>
28
28
  ```
29
29
 
30
- Three CDN forms are supported:
30
+ These CDN forms are supported:
31
31
 
32
- * `sdk-v-0.8.1.js` (current 0.8.x, pinned)
32
+ * `sdk-v-0.8.3.js` (current 0.8.x, pinned)
33
+ * `sdk-v-0.8.2.js` (0.8.2, pinned)
34
+ * `sdk-v-0.8.1.js` (0.8.1, pinned)
33
35
  * `sdk-v-0.8.0.js` (0.8.0, pinned)
34
36
  * `sdk-v-0.7.7.js` (last 0.7.x, pinned)
35
37
  * `sdk.js` (floating pointer to the latest release; updates automatically when a new version ships)
36
38
 
39
+ If you pin, note that you do not pick up fixes automatically. 0.8.3 fixes a bug that made Medical Mutual and SimplePay Health impossible to connect, so pinned integrations on 0.8.0–0.8.2 should move up.
40
+
37
41
  Pinned versions stay available indefinitely. See [Migrating from 0.7 to 0.8](./migration-0.7-to-0.8.md) for the breaking-change story before flipping the floating pointer in production.
38
42
 
39
43
  ### Via npm
package/docs/error.md CHANGED
@@ -77,18 +77,27 @@ in the hero element.
77
77
  | HTTP status | Detail message | Meaning | Recovery |
78
78
  |---|---|---|---|
79
79
  | 401 | `Missing token` | The SSE URL was hit without a `?token=` query param | Shouldn't happen via the SDK; if you proxy the URL yourself, forward the token |
80
- | 401 | `Task token has expired` | JWT `exp` passed (10-minute TTL after dispatch) | Re-submit the credentials to get a fresh token |
81
- | 401 | `Task not available` | The Redis `progress_task_owner` pointer expired (typically same TTL as token) | Same: re-submit |
80
+ | 401 | `Task token has expired` | JWT `exp` passed (10-minute TTL, sized to one connection) | Re-fetch the policy holder for a fresh token and resubscribe. The SDK does this automatically |
81
+ | 401 | `Task not available` | The Redis `progress_task_owner` pointer is gone: cleared on terminal state, or the ~90-minute observation window lapsed | Usually means the task finished. Read the outcome from the validate-credentials GET rather than retrying the stream |
82
82
  | 403 | `Not your task` | The JWT and Redis pointer disagree on `user_id` | Token reuse across sessions; re-init the SDK |
83
83
  | 422 | `Task token is invalid` | Bad signature, unknown algorithm, or malformed claims | Token was tampered with or minted by a different deploy |
84
84
  | 422 | `Task token does not match requested task` | The token's `task_id` claim doesn't match the URL path | Token reuse against the wrong task; re-submit |
85
85
  | 422 | `Task token audience mismatch` | `aud` claim isn't `sdk:sse:progress` | Token from a different service was forwarded |
86
86
  | 422 | `Task token missing required claim: <name>` | Mint upstream produced a token missing one of `exp` / `iat` / `task_id` / `sub` | Backend bug; report it |
87
87
 
88
- On any error the SDK transitions the active validation to
89
- `pending_async` (visible in the hero / corner panel) and leaves the
90
- wizard usable. The user can keep adding carriers; when they return
91
- later the validation's true terminal state is reflected.
88
+ On any of these the SDK first tries to reattach (re-fetch the policy
89
+ holder for a fresh `task_token`, resubscribe), because the stream
90
+ failing says nothing about whether the validation is still running.
91
+ Only if that can't proceed does the validation go to `pending_async`
92
+ (visible in the hero / corner panel), and the wizard stays usable
93
+ throughout. The user can keep adding carriers; when they return later
94
+ the validation's true terminal state is reflected.
95
+
96
+ `Task not available` is the interesting one: the Redis pointer is
97
+ cleared the moment a task reaches a terminal state, so this now
98
+ usually means the validation *finished*, not that a window lapsed. The
99
+ SDK reads the outcome from the validate-credentials GET and shows the
100
+ real terminal state rather than asking the user to re-submit.
92
101
 
93
102
  ## Cred-submit + validation errors
94
103
 
package/docs/faq.md CHANGED
@@ -32,7 +32,7 @@ Embed the SDK in a WebView via [`react-native-webview`](https://github.com/react
32
32
  The older `stream-connect-sdk-hook` npm package (v0.6.2) is deprecated. Existing integrations keep working but won't receive feature updates: no SSE-driven validation, no inline 2FA, no fix-credentials status badges, no PAA support. New integrations should use the WebView pattern.
33
33
 
34
34
  ## I'd like to create a more customized flow for how a user enters credentials and validation.
35
- The default recommendation for customizing the SDK flow is to use the various sdk [Callbacks](client-usage.md#callbacks).
35
+ The default recommendation for customizing the SDK flow is to use the various sdk [Callbacks](client-usage.md#lifecycle-callbacks-in-detail).
36
36
 
37
37
  The SDK renders various steps with default templates which should be editted post render using JS and CSS. However, if you would like
38
38
  to create more customized widgets it is possible to turn off the default rendering using the various `renderXStep` values within the
@@ -42,7 +42,7 @@ If you are to turn of the default template rendering, the callbacks associated w
42
42
  objects in their parameters which will allow an implementor to mirror all of the functionality previously defined in the default
43
43
  template.
44
44
 
45
- Each of the provided information is present in the [Callbacks](client-usage.md#callbacks) docs.
45
+ Each of the provided information is present in the [Callbacks](client-usage.md#lifecycle-callbacks-in-detail) docs.
46
46
 
47
47
  ## How do I use the data from the SDK?
48
48
  The StreamConnect SDK is designed to take in carrier credentials, save them to the TPAStream sytem, and then validate the credentials.
@@ -32,7 +32,11 @@ StreamConnect({
32
32
 
33
33
  When a returning user opens the SDK in fix-credentials mode, the
34
34
  first screen offers two paths: add a new carrier, or manage existing
35
- ones.
35
+ ones. When any connected carrier needs attention, the "Manage your
36
+ carriers" tile carries a pill reading "N logins need attention": red
37
+ if any login is critical, amber otherwise, and absent at zero. The
38
+ count uses the same severity rules as the status badges below and
39
+ updates as validations finish.
36
40
 
37
41
  ![Select enroll process](https://tpastream-public.s3.amazonaws.com/sdk-docs/fix-credentials/select-enroll-widget.png)
38
42
 
@@ -19,7 +19,7 @@ Here is what the test htmlscript looks like.
19
19
  ```
20
20
 
21
21
  `<script src="https://app.tpastream.com/static/js/sdk.js"></script>` in the head will bring down the latest version of the StreamConnect SDK. If you need to pin to a specific version, change the src to something like
22
- `<script src="https://app.tpastream.com/static/js/sdk-v-0.8.1.js"></script>`. Pinned versions remain available indefinitely.
22
+ `<script src="https://app.tpastream.com/static/js/sdk-v-0.8.3.js"></script>`. Pinned versions remain available indefinitely.
23
23
 
24
24
  The 0.8 SDK is visually self-contained: it does not require Bootstrap, jQuery, FontAwesome, or any other host-page CSS. Host pages that already load Bootstrap can keep doing so without conflict. SDK styles use a `tpa-` class prefix to avoid name collisions with host CSS, and the reset/theme variables are wrapped under `.tpa-sdk-root` so they only affect the SDK subtree.
25
25
 
package/docs/sdk-flow.md CHANGED
@@ -37,7 +37,7 @@ In 0.8 this is no longer a blocking intermediate widget. After the user submits
37
37
 
38
38
  Auth on the SSE channel is a short-lived task-scoped JWT (audience `sdk:sse:progress`, bound to the user + validation task, 10-minute TTL) returned in the credential-submit response as `task_token`. The SDK forwards it as a `?token=...` query param on the SSE subscription; integrators do not need to handle the token directly.
39
39
 
40
- State transitions arrive as they happen rather than on the 5-second polling cadence used in 0.7.x. The server-side stream has a hard ~10-minute deadline; if validation hasn't terminated by then the server emits a `timeout` event and closes the stream. The SDK transitions that validation to a `pending_async` state which keeps it visible in the hero / corner-panel UI (the wizard does NOT auto-advance to FinishedEasyEnroll). The user can keep using the SDK; when they return later, the next call to the backend will reflect whatever terminal state the validation reached.
40
+ State transitions arrive as they happen rather than on the 5-second polling cadence used in 0.7.x. The server-side stream has a hard ~10-minute deadline; if validation hasn't terminated by then the server emits a `timeout` event and closes the stream. That deadline belongs to the connection, not to the validation. The task behind it runs for as long as it needs (the post-MFA claims pull is usually what takes the time) and stays observable for its whole life. So the SDK reattaches: it re-fetches the policy holder for the still-active `task_id` plus a freshly minted `task_token` and resubscribes, and the user keeps seeing live state across as many ten-minute connections as the validation needs. The validation lands in `pending_async` only when reattach can't proceed: it genuinely ended, the backend can't be reached, or the ten-reattach budget is spent. That state keeps it visible in the hero / corner-panel UI (the wizard does NOT auto-advance to FinishedEasyEnroll). The user can keep using the SDK; when they return later, the next call to the backend will reflect whatever terminal state the validation reached.
41
41
 
42
42
  `doneRealTime` still fires for back-compat. The `realtimeTimeout` init option is accepted but ignored (the timeout is now server-side).
43
43
 
@@ -23,7 +23,7 @@ hero re-renders with the right copy and the right input control:
23
23
  | `submitting` | "Working on it…" | Wait |
24
24
  | `success` | "Connected!" (green) | Done; auto-dismisses after a short hold |
25
25
  | `failure` | "Couldn't connect" (red) with the carrier message | Reconnect via the tile |
26
- | `pending_async` | "Still working on it" | Come back later; SDK is no longer streaming live |
26
+ | `pending_async` | "Still working on it" | Come back later; the SDK has stopped streaming live (reattach ran out of road) |
27
27
 
28
28
  The hero is rendered by `ActiveValidationsHero` and lives alongside
29
29
  the wizard step state, so the user can keep navigating
@@ -88,19 +88,32 @@ without re-running the entire credential flow.
88
88
 
89
89
  ### Stream times out (10-minute deadline)
90
90
 
91
- The server-side SSE deadline is ~10 minutes per stream. If the user
92
- takes longer than that to retrieve and enter the code, the stream
93
- closes and the validation moves to `pending_async`. The hero shows
94
- "Still working on it" and the validation stays visible. The user can
95
- keep using the SDK; the task itself isn't cancelled. When they come
96
- back later, the validation's terminal state will be reflected on the
97
- next page load.
91
+ The ~10-minute SSE deadline is per stream, not per validation. If the
92
+ user takes longer than that to retrieve and enter the code, the server
93
+ emits `timeout` and closes the connection, and the SDK reattaches: it
94
+ re-fetches the policy holder for the still-active `task_id` and a
95
+ freshly minted `task_token`, then resubscribes. The hero keeps showing
96
+ live state; the member sees nothing. A validation stays observable for
97
+ about 90 minutes, and the SDK will spend up to ten reattaches covering
98
+ it.
99
+
100
+ The member's real deadline is much tighter and is enforced by the task,
101
+ not the transport: the worker waits ~5 minutes at each interactive MFA
102
+ stage for a method choice or a code before giving up.
103
+
104
+ If the validation actually ended while the SDK was between
105
+ connections, the reattach finds no active task, reads the outcome from
106
+ the validate-credentials GET, and shows the real terminal state.
98
107
 
99
108
  ### Stream disconnects mid-2FA
100
109
 
101
- A network blip, server-side close, or proxy drop during the validation
102
- lands the validation in `pending_async` the same way the timeout does.
103
- The backend task continues; the SDK just can't observe it live anymore.
110
+ A network blip, server-side close, or proxy drop is handled the same
111
+ way as a timeout, with a short backoff between attempts so an outage
112
+ doesn't turn into a retry storm. Only when reattach itself can't
113
+ proceed (the backend is unreachable, or ten attempts are spent) does
114
+ the validation land in `pending_async`. The backend task
115
+ continues either way; `pending_async` means the SDK stopped watching,
116
+ not that anything was cancelled.
104
117
 
105
118
  `AbortController.abort()` is intentionally NOT treated as a disconnect:
106
119
  the SDK aborts on unmount and on terminal-state cleanup, and surfacing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stream-connect-sdk",
3
- "version": "0.8.3",
3
+ "version": "0.8.5",
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",