stream-connect-sdk 0.8.7 → 0.8.8
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 +28 -0
- package/README.md +18 -0
- package/docs/client-usage.md +4 -4
- package/docs/connect-access-token.md +17 -12
- package/docs/interop.md +2 -3
- package/package.json +1 -1
- package/sdk-headless.js +1 -1
- package/sdk.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,34 @@ 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.8
|
|
8
|
+
|
|
9
|
+
### A connect access token in the URL fragment
|
|
10
|
+
|
|
11
|
+
The SDK now also reads `accessToken` from the URL fragment
|
|
12
|
+
(`#accessToken=...`) and strips it with `history.replaceState`,
|
|
13
|
+
keeping the rest of the fragment, hash routes included. A fragment is
|
|
14
|
+
never sent to the host's web server, so it stays out of access logs.
|
|
15
|
+
The query-string form (`?accessToken=...`) still works and is still
|
|
16
|
+
stripped; when both are present the fragment wins.
|
|
17
|
+
|
|
18
|
+
The docs no longer say that `app.tpastream.com` adds `?accessToken=`
|
|
19
|
+
to the Patient Access API return URL. It does not. The session
|
|
20
|
+
continues on the `connectAccessToken` your page passes at init.
|
|
21
|
+
|
|
22
|
+
### The credential submit sends the member email, not the user object
|
|
23
|
+
|
|
24
|
+
The add-carrier and fix-carrier submits (`POST` and `PUT
|
|
25
|
+
policy_holder_sdk/policy_holder`) sent `user`, the whole user object
|
|
26
|
+
with every policy holder on the member, although the server reads only
|
|
27
|
+
its email. They now send `user_email` in its place. The server already
|
|
28
|
+
accepts `user_email`, and the two-factor calls already send it. The
|
|
29
|
+
body no longer grows with the member's policy holders: with two
|
|
30
|
+
carriers it drops from about 2.2 KB to about 250 bytes.
|
|
31
|
+
|
|
32
|
+
No `init()` or callback change. `employer_id` and the credential
|
|
33
|
+
fields are sent as before.
|
|
34
|
+
|
|
7
35
|
## 0.8.7
|
|
8
36
|
|
|
9
37
|
### axios removed
|
package/README.md
CHANGED
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
## Version
|
|
6
6
|
|
|
7
|
+
### 0.8.8
|
|
8
|
+
|
|
9
|
+
The credential submit (add or fix a carrier) now sends the member's email as `user_email` instead of the whole user object, so the request no longer grows with each carrier the member has. No API change: the server already reads `user_email`.
|
|
10
|
+
|
|
11
|
+
The SDK also reads a connect access token from the URL fragment (`#accessToken=...`) and strips it from the address bar. A fragment never reaches the host's web server, so the token stays out of its access logs. The query-string form still works.
|
|
12
|
+
|
|
7
13
|
### 0.8.7
|
|
8
14
|
|
|
9
15
|
Dependency release: axios is removed. The SDK now sends its requests with the browser's built-in `fetch`, which takes about 26 packages out of the SDK's runtime dependency tree. The requests, headers and query strings on the wire are unchanged. Errors passed to `handleFormErrors` and `doneGetSDK` keep `response.status`, `response.data`, `message`, `code` and `config`; see the [CHANGELOG](./CHANGELOG.md) for the few fields that changed. Fix: after a connect token refresh, later requests now carry the new token instead of the original one.
|
|
@@ -45,6 +51,18 @@ This SDK embeds the [EasyEnrollment platform](https://www.easyenrollment.net) in
|
|
|
45
51
|
Latest highlights below. The full per-version changelog lives in
|
|
46
52
|
[CHANGELOG.md](./CHANGELOG.md).
|
|
47
53
|
|
|
54
|
+
### 0.8.8 highlights
|
|
55
|
+
|
|
56
|
+
* The credential submit (`POST` and `PUT policy_holder_sdk/policy_holder`)
|
|
57
|
+
sends `user_email` in place of the `user` object. The body no longer
|
|
58
|
+
carries every policy holder on the member, so it stays at a few
|
|
59
|
+
hundred bytes.
|
|
60
|
+
* No `init()` or callback change. The server already reads
|
|
61
|
+
`user_email`, and the two-factor calls already send it.
|
|
62
|
+
* A connect access token in the URL fragment (`#accessToken=...`) is
|
|
63
|
+
read and stripped, like the `?accessToken=...` query form. When both
|
|
64
|
+
are present, the fragment wins.
|
|
65
|
+
|
|
48
66
|
### 0.8.7 highlights
|
|
49
67
|
|
|
50
68
|
* axios is removed. The SDK's HTTP client is now a small wrapper
|
package/docs/client-usage.md
CHANGED
|
@@ -147,7 +147,7 @@ A first-class React package with `peerDependencies` on `react` (no second React
|
|
|
147
147
|
| `enablePatientAccessAPISinglePage` | Same as `enablePatientAccessAPI` but performs the redirect in the current tab instead of a new window. Takes precedence over `enablePatientAccessAPI` when `true`. | Boolean | `false` |
|
|
148
148
|
| `forceEndStep` | Skip directly to the end widget on load. Accepts the legacy boolean form (`true` → end widget) or an explicit step number (`5` is the `FinishedEasyEnroll` step). Auto-applied when the URL contains `?forceTPAStreamSdkEnd=1` (the flag is then stripped from the address bar). | Boolean or Number | `false` |
|
|
149
149
|
| `includePayerBlogs` | Enable optional payer-updates blog on each enrollment form. Shows additional info about the carrier. | Boolean | `false` |
|
|
150
|
-
| `connectAccessToken` | Required if [Connect Access Token](./connect-access-token.md) advanced security is enabled.
|
|
150
|
+
| `connectAccessToken` | Required if [Connect Access Token](./connect-access-token.md) advanced security is enabled. An `accessToken` on the page URL (fragment or query string), if present, overrides this option for that load and is stripped from the URL via `history.replaceState`; `app.tpastream.com` does not add one. See [Redirect query parameters](#redirect-query-parameters-patient-access-api). | String | unset |
|
|
151
151
|
| `connectAccessTokenRefreshFn` | Async function the SDK calls to mint a fresh `connectAccessToken` when the current one has expired (server returns `error_code: "expired_connect_token"`). When provided, expired-token responses trigger a transparent refresh + retry instead of bubbling up as a failed request. Without it, the SDK fires `onConnectAccessTokenExpired` and dispatches a `tpastream-connect-token-expired` window event so the host page can prompt the user. Connect tokens have a ~60-minute TTL, so long-lived pages benefit. | `() => Promise<string>` | unset |
|
|
152
152
|
| `renderChoosePayer` | Render the built-in choose-payer widget. If `false`, you drive payer selection from the `doneChoosePayer` callback. | Boolean | `true` |
|
|
153
153
|
| `renderPayerForm` | Render the built-in credentials form. If `false`, drive it from `doneCreatedForm`. | Boolean | `true` |
|
|
@@ -199,12 +199,12 @@ Don't set these in production code.
|
|
|
199
199
|
|
|
200
200
|
## Redirect query parameters (Patient Access API)
|
|
201
201
|
|
|
202
|
-
When the Patient Access API flow returns the user from a carrier site back to the page hosting the SDK, the
|
|
202
|
+
When the Patient Access API flow returns the user from a carrier site back to the page hosting the SDK, the SDK reads these parameters automatically on init:
|
|
203
203
|
|
|
204
|
-
*
|
|
204
|
+
* **`accessToken`**: `app.tpastream.com` does not put a connect access token on the return URL. The session continues on the `connectAccessToken` your page passed at init and the rolling `X-Set-Connect-Access-Token` header. If a URL does carry one, in the fragment (`#accessToken=...`, from 0.8.8) or the query string (`?accessToken=...`), the SDK uses it in place of `connectAccessToken` and strips it. The fragment wins when both are present.
|
|
205
205
|
* **`?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.
|
|
206
206
|
|
|
207
|
-
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
|
|
207
|
+
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 an access token cannot leak via history navigation or browser autofill.
|
|
208
208
|
|
|
209
209
|
> **Referrer caveat:** `replaceState` runs only after the SDK script has loaded and executed. Any resources, third-party scripts, or analytics beacons fetched *earlier* in the page lifecycle can still receive the token-bearing URL in the `Referer` header. For the full referrer-protection story (host-page `<meta name="referrer">` settings, CSP `Content-Security-Policy: referrer`, and the redirect-URL hygiene we recommend), see the Pre-SDK referrer caveat in [`connect-access-token.md`](./connect-access-token.md).
|
|
210
210
|
|
|
@@ -178,22 +178,27 @@ hook is that the member loses any in-progress credential entry.
|
|
|
178
178
|
|
|
179
179
|
## Mid-session token refresh (Patient Access API redirect)
|
|
180
180
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
`
|
|
187
|
-
|
|
181
|
+
`app.tpastream.com` does not put a connect access token on the URL
|
|
182
|
+
it returns the member to after a Patient Access API sign-in. A token
|
|
183
|
+
in a URL reaches the host's web server logs and any script that reads
|
|
184
|
+
the address, so the session continues on the `connectAccessToken`
|
|
185
|
+
your page passes at init, renewed by the rolling
|
|
186
|
+
`X-Set-Connect-Access-Token` header. The return is an ordinary load
|
|
187
|
+
of your page, so it gets the `connectAccessToken` your page passes on
|
|
188
|
+
every load.
|
|
189
|
+
|
|
190
|
+
The SDK still accepts a token on the URL, for integrations that put
|
|
191
|
+
one there themselves: `#accessToken=...` in the fragment (from 0.8.8;
|
|
192
|
+
a fragment is never sent to your web server) or `?accessToken=...` in
|
|
193
|
+
the query string. It uses that token in place of `connectAccessToken`
|
|
194
|
+
and strips it from the URL via `history.replaceState`.
|
|
188
195
|
|
|
189
196
|
Note: `replaceState` runs after the SDK script loads, so any
|
|
190
197
|
resources or third-party scripts loaded by the host page *before*
|
|
191
198
|
the SDK runs (analytics beacons, ad pixels, anything in the `<head>`
|
|
192
|
-
that fires its own requests) can still see
|
|
193
|
-
token
|
|
194
|
-
anything
|
|
195
|
-
script tag or strip the `accessToken` query param server-side
|
|
196
|
-
before serving the post-redirect page.
|
|
199
|
+
that fires its own requests) can still see a token-bearing URL. If
|
|
200
|
+
you put a token on the URL yourself, use the fragment, and load
|
|
201
|
+
anything that reads the address after the SDK script tag.
|
|
197
202
|
|
|
198
203
|
See [Client Usage > Redirect query
|
|
199
204
|
parameters](./client-usage.md#redirect-query-parameters-patient-access-api)
|
package/docs/interop.md
CHANGED
|
@@ -23,7 +23,7 @@ The legacy alias `enableInteropSinglePage` is also still accepted with the same
|
|
|
23
23
|
|
|
24
24
|
After the carrier redirect completes, the SDK reads two URL parameters automatically on load:
|
|
25
25
|
|
|
26
|
-
*
|
|
26
|
+
* `accessToken`: `app.tpastream.com` does not add one. If a return URL carries one, in the fragment (`#accessToken=...`, from 0.8.8) or the query string, the SDK uses it in place of `connectAccessToken`.
|
|
27
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.
|
|
@@ -31,8 +31,7 @@ Both are stripped from the URL via `history.replaceState` so they cannot leak vi
|
|
|
31
31
|
## See also
|
|
32
32
|
|
|
33
33
|
* [Connect Access Token](./connect-access-token.md): how the
|
|
34
|
-
|
|
35
|
-
model
|
|
34
|
+
connect access token reaches the session after a carrier return
|
|
36
35
|
* [Fix Credentials](./fix-credentials.md): Patient Access API carriers
|
|
37
36
|
show up in the same fix-credentials list with the same status badges
|
|
38
37
|
as inline-credential carriers
|
package/package.json
CHANGED