stream-connect-sdk 0.7.6 → 0.8.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/CHANGELOG.md +279 -0
- package/README.md +72 -111
- package/docs/README.md +52 -0
- package/docs/client-usage.md +405 -0
- package/docs/connect-access-token-screenshots/connect-access-token-pattern.png +0 -0
- package/docs/connect-access-token.md +71 -0
- package/docs/error.md +149 -0
- package/docs/faq.md +77 -0
- package/docs/fix-credentials/select-enroll-widget.png +0 -0
- package/docs/fix-credentials.md +151 -0
- package/docs/flow-screenshots/choose-payer.png +0 -0
- package/docs/flow-screenshots/enter-credentials.png +0 -0
- package/docs/flow-screenshots/pop-up.png +0 -0
- package/docs/flow-screenshots/realtime-validation.png +0 -0
- package/docs/flow-screenshots/terms-of-service.png +0 -0
- package/docs/headless.md +107 -0
- package/docs/interop-screenshots/Interop SDK Flow Legacy.png +0 -0
- package/docs/interop-screenshots/InteropSDKFlow.png +0 -0
- package/docs/interop.md +38 -0
- package/docs/migration-0.7-to-0.8.md +110 -0
- package/docs/quickstart-screenshots/demo-init-page.png +0 -0
- package/docs/quickstart-screenshots/employer-key-page.png +0 -0
- package/docs/quickstart-screenshots/error-init-page.png +0 -0
- package/docs/quickstart.md +247 -0
- package/docs/sdk-flow.md +43 -0
- package/docs/theme.md +47 -0
- package/docs/two-factor.md +137 -0
- package/package.json +67 -79
- package/sdk-headless.js +2 -0
- package/sdk.js +1 -1
- package/.babelrc +0 -4
- package/.rgignore +0 -1
package/docs/faq.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# FAQ
|
|
2
|
+
Here we attempt to address several of the common questions which might pop-up while an implementor is working with the StreamConnect SDK
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## What is a user in the configuration block?
|
|
6
|
+
A `user` is a TPAStream concept which consolidates all of the information of a given set of participant credentials. Underneath a user:
|
|
7
|
+
there are members which have credentials, unique-keys defined by an implementor to identify the user in the system, a unique email which acts as the default identifier of the participant, and a name.
|
|
8
|
+
|
|
9
|
+
An example of a TPAStream user is an implementor's Admin Credentials for TPAStream. However, these users are configured as policy holders.
|
|
10
|
+
|
|
11
|
+
Notes for users in the configuration block:
|
|
12
|
+
* A user cannot be an Admin within the TPAStream system.
|
|
13
|
+
* A user cannot be associated with 2 different SDK Tokens.
|
|
14
|
+
* A user must have a first and last name provided.
|
|
15
|
+
* A user must have a unique email.
|
|
16
|
+
|
|
17
|
+
For more information on configuration objects see our [Client Usage Docs](client-usage.md).
|
|
18
|
+
|
|
19
|
+
## How do I make test users for the SDK (A Useful Gmail Trick)?
|
|
20
|
+
When implementing the StreamConnect SDK it can be useful to use a test user object if you do not have access to provided user credentials.
|
|
21
|
+
|
|
22
|
+
We suggest that you use an email which does not currently have an account in TPAStream, however, if you have a gmail configured to the TPAStream Admin portal you can follow this pattern to create a new unique user in TPAStream that still will receive the same emails.
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
youremail@gmail.com -> youremail+testingsdk@gmail.com
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## I'd like to use React Native
|
|
29
|
+
|
|
30
|
+
Embed the SDK in a WebView via [`react-native-webview`](https://github.com/react-native-webview/react-native-webview) and ferry callbacks to the native shell via `postMessage`. The [Quickstart](./quickstart.md#react-native) has a full walkthrough, and the [SDK Hook docs](../sdk-hook/docs/README.md#recommended-webview-pattern-for-react-native) cover Patient Access API redirects and the SDK's complete callback surface.
|
|
31
|
+
|
|
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
|
+
|
|
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).
|
|
36
|
+
|
|
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
|
+
to create more customized widgets it is possible to turn off the default rendering using the various `renderXStep` values within the
|
|
39
|
+
configuration.
|
|
40
|
+
|
|
41
|
+
If you are to turn of the default template rendering, the callbacks associated with each of those steps will provide functions and
|
|
42
|
+
objects in their parameters which will allow an implementor to mirror all of the functionality previously defined in the default
|
|
43
|
+
template.
|
|
44
|
+
|
|
45
|
+
Each of the provided information is present in the [Callbacks](client-usage.md#callbacks) docs.
|
|
46
|
+
|
|
47
|
+
## How do I use the data from the SDK?
|
|
48
|
+
The StreamConnect SDK is designed to take in carrier credentials, save them to the TPAStream sytem, and then validate the credentials.
|
|
49
|
+
If you are implementing the whole Stream Connect flow, including interfacing with the TPAStream API and using TPAStream webhooks, you will find the [doneEasyEnroll](client-usage.md#doneeasyenroll) callback to hold the main pieces of information you need.
|
|
50
|
+
|
|
51
|
+
There we define specifically a `policyHolder` which can be thought of as the carrier credentials that were just submitted.
|
|
52
|
+
This `policyHolder` will have:
|
|
53
|
+
* An `policy_holder_id` which is its unique identifier in TPAStream
|
|
54
|
+
* A `login_problem` which will define the state of the credentials. See [doneEasyEnroll](client-usage.md#doneeasyenroll)
|
|
55
|
+
* And a `payer_id` all of which can be useful when implementing the TPAStream Webhooks.
|
|
56
|
+
|
|
57
|
+
For implementing the TPAStream webhooks to get information on when a new claim is added to TPAStream or when the first crawl of the credentials is completed see our [Webhook Docs](https://developers.tpastream.com/en/latest/connect.html#webhooks)
|
|
58
|
+
|
|
59
|
+
## What is the tenant configuration block?
|
|
60
|
+
Within the TPAStream configuration examples as well as the [Client Usage Docs](client-usage.md) you might sometimes see
|
|
61
|
+
a `tenant` block defined within it. This specific configuraiton option is determined when your `sdkToken` is created.
|
|
62
|
+
|
|
63
|
+
This can almost always be left blank, unless you are an entity which is managing multiple different tenants within TPAStream.
|
|
64
|
+
If the latter is the case you will have been informed when your token was created.
|
|
65
|
+
|
|
66
|
+
## What is "vendor" within the various configuration blocks?
|
|
67
|
+
When configuring the SDK a user will see "`vendor`" within the configuration block of the `employer` object. This `vendor` value
|
|
68
|
+
will almost always be set to the value `"internal"`.
|
|
69
|
+
|
|
70
|
+
A Vendor in TPA Stream indicates which System of Record an identifier belongs to. If the identifier is the unique database ID from your
|
|
71
|
+
own in-house system, simply refer to it as "internal"
|
|
72
|
+
|
|
73
|
+
## I have a unique key for my participants, how can I associate those in TPAStream?
|
|
74
|
+
Using the `user` configuration object you can define `memberSystemKey`. This system key will be defined under the same vendor as the
|
|
75
|
+
employer block, since a member can only exist under 1 employer.
|
|
76
|
+
|
|
77
|
+
See our [Client Usage Docs](client-usage.md) for more information on the `user` object block.
|
|
Binary file
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# Fix Credentials
|
|
2
|
+
|
|
3
|
+
The fix-credentials view lets a returning user see and act on every
|
|
4
|
+
carrier they've connected: reconnect a broken login, finish a 2FA
|
|
5
|
+
challenge, or add a new carrier. The SDK enters this mode
|
|
6
|
+
automatically when a [Connect Access Token](./connect-access-token.md)
|
|
7
|
+
is supplied at init; no separate flag is required.
|
|
8
|
+
|
|
9
|
+
## Init options
|
|
10
|
+
|
|
11
|
+
```javascript
|
|
12
|
+
StreamConnect({
|
|
13
|
+
el: '#react-hook',
|
|
14
|
+
apiToken: 'your-sdk-token',
|
|
15
|
+
connectAccessToken: '<minted server-side, see connect-access-token.md>',
|
|
16
|
+
// ... rest of init
|
|
17
|
+
});
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
* `connectAccessToken` (string) - presence of this token is the
|
|
21
|
+
signal for member-portal mode. See
|
|
22
|
+
[Connect Access Token](./connect-access-token.md) for how it's
|
|
23
|
+
minted and rotated.
|
|
24
|
+
|
|
25
|
+
> **Deprecated:** a `fixCredentials: true` init option used to opt
|
|
26
|
+
> into this view. It is no longer needed in 0.8 and is ignored
|
|
27
|
+
> (passing it logs a one-time console deprecation warning); behavior
|
|
28
|
+
> is now driven entirely by `connectAccessToken` presence, which was
|
|
29
|
+
> already a hard requirement.
|
|
30
|
+
|
|
31
|
+
## What the user sees
|
|
32
|
+
|
|
33
|
+
The fix-credentials view lists every policy-holder the user has
|
|
34
|
+
connected. Each carrier renders as a tile with:
|
|
35
|
+
|
|
36
|
+
* The carrier logo and name
|
|
37
|
+
* A status badge (described below)
|
|
38
|
+
* "Last synced N min/hr/day ago" when there's a recent successful crawl
|
|
39
|
+
|
|
40
|
+
### Status badges
|
|
41
|
+
|
|
42
|
+
Each tile shows a status badge driven by the PH's `login_problem` and
|
|
43
|
+
the recency of the last successful crawl. The label space is two
|
|
44
|
+
coarse fallbacks plus a per-problem set:
|
|
45
|
+
|
|
46
|
+
| Badge text | When it fires |
|
|
47
|
+
|---|---|
|
|
48
|
+
| **Connected** | Severity is `ok`. That covers two cases: (a) `login_problem` is null, regardless of last-sync recency, and (b) `login_problem` is a warning-class value but a successful sync landed in the last 7 days, which downgrades the warning visually. See `severityFor` for the exact rule. |
|
|
49
|
+
| **Validating now** | A validation task is in flight against this PH. The tile pulses; the floating hero (top of the page) shows live progress. |
|
|
50
|
+
| **Action needed** | Severity is `warning` or `critical` but `login_problem` is null (we know something needs attention but the carrier didn't tell us what). |
|
|
51
|
+
| *Per-problem text* | Severity is `warning` or `critical` and `login_problem` is set. The badge uses the human label from `LOGIN_PROBLEM_LABELS` (e.g. `Invalid password`, `Locked account`, `Needs 2FA`, `Security question`) so the user knows what to fix before clicking. |
|
|
52
|
+
|
|
53
|
+
Severity classes (canonical sets in
|
|
54
|
+
[`assets/sdk/types.ts`](../assets/sdk/types.ts) `CRITICAL_LOGIN_PROBLEMS`
|
|
55
|
+
and `WARNING_LOGIN_PROBLEMS`):
|
|
56
|
+
|
|
57
|
+
- **`ok`**: no `login_problem`, OR a warning-class problem with a
|
|
58
|
+
successful sync in the last 7 days (the recent claim flow downgrades
|
|
59
|
+
the warning visually).
|
|
60
|
+
- **`warning`**: `login_problem` in `{incomplete, needs_two_factor,
|
|
61
|
+
sec_question, wrong_secondary, mfa_carrier, migrating}`. The carrier
|
|
62
|
+
is reachable, the user just has an outstanding action item.
|
|
63
|
+
- **`critical`**: `login_problem` in `{invalid, invalid_username_format,
|
|
64
|
+
locked, broken, invalid_interop_token}`. The carrier is unreachable
|
|
65
|
+
until the user reconnects.
|
|
66
|
+
|
|
67
|
+
The label and severity logic live in
|
|
68
|
+
[`assets/sdk/components/PayerImages.tsx`](../assets/sdk/components/PayerImages.tsx)
|
|
69
|
+
(`labelFor` / `severityFor` / `LOGIN_PROBLEM_LABELS`). Severity maps
|
|
70
|
+
to badge color via the `tpa-` theme tokens, so a customer-supplied
|
|
71
|
+
[`theme.primaryColor`](./theme.md) doesn't recolor the semantic
|
|
72
|
+
status states.
|
|
73
|
+
|
|
74
|
+
### Sort order
|
|
75
|
+
|
|
76
|
+
Tiles are sorted top-to-bottom by:
|
|
77
|
+
|
|
78
|
+
1. In-flight validations (the carrier the user just submitted)
|
|
79
|
+
2. Critical-broken PHs (Reconnect)
|
|
80
|
+
3. Warning PHs (Action needed)
|
|
81
|
+
4. Healthy PHs, most-recently-synced first
|
|
82
|
+
|
|
83
|
+
This puts the carriers that need attention at the top, with the
|
|
84
|
+
just-submitted one always visually pinned next to the hero.
|
|
85
|
+
|
|
86
|
+
### "Recently added" section
|
|
87
|
+
|
|
88
|
+
PHs created in the last 7 days are grouped into a "Recently added"
|
|
89
|
+
section above the main list, so the user can see what they just
|
|
90
|
+
connected without scrolling. The remaining carriers render under
|
|
91
|
+
"Your other carriers" (or "Your carriers" if there's no recent
|
|
92
|
+
section).
|
|
93
|
+
|
|
94
|
+
## Empty state
|
|
95
|
+
|
|
96
|
+
A user with no connected carriers sees:
|
|
97
|
+
|
|
98
|
+
> You haven't connected any carriers yet.
|
|
99
|
+
|
|
100
|
+
with a single "Your carriers" heading. Selecting a carrier from
|
|
101
|
+
choose-payer is still reachable via the "Add a new carrier" entry
|
|
102
|
+
point.
|
|
103
|
+
|
|
104
|
+
## Reconnecting a carrier
|
|
105
|
+
|
|
106
|
+
Clicking any tile with **Reconnect** or **Action needed** lands the
|
|
107
|
+
user on the credentials form for that carrier, pre-filled with the
|
|
108
|
+
username on file. The submit returns the user back to the
|
|
109
|
+
fix-credentials list with the new validation in flight (visible in
|
|
110
|
+
the hero + on the tile as "Validating now").
|
|
111
|
+
|
|
112
|
+
The wizard does NOT take over the screen during validation; multiple
|
|
113
|
+
validations can run in parallel and the user can keep navigating.
|
|
114
|
+
|
|
115
|
+
## Adding a new carrier from fix-credentials
|
|
116
|
+
|
|
117
|
+
Users in member-portal mode see an "Add a new carrier" entry
|
|
118
|
+
that drops them into the standard choose-payer flow (step 3). Submit
|
|
119
|
+
returns them to the choose-payer picker (step 3), NOT the
|
|
120
|
+
fix-credentials list, so they can chain another "Add a new carrier"
|
|
121
|
+
without an extra back-button trip. The freshly-added carrier shows up
|
|
122
|
+
in the picker's "already connected" markers via the user-refresh that
|
|
123
|
+
follows the submit.
|
|
124
|
+
|
|
125
|
+
To get back to the fix-credentials list itself the user uses the back
|
|
126
|
+
button or navigates back from choose-payer.
|
|
127
|
+
|
|
128
|
+
(Implementation note: the return-step logic at
|
|
129
|
+
[SDK.tsx](../assets/sdk/components/SDK.tsx) `returnStep` uses
|
|
130
|
+
`state.policyHolderId` to distinguish "reconnect existing" (PH set →
|
|
131
|
+
return to step 2, the fix-credentials list) from "add new" (PH null
|
|
132
|
+
→ return to step 3, the picker).)
|
|
133
|
+
|
|
134
|
+
## Hooks for custom rendering
|
|
135
|
+
|
|
136
|
+
* `doneFixCredentials` - fires once per render of the fix-credentials
|
|
137
|
+
view, after data loads. Useful for analytics or applying custom
|
|
138
|
+
styling.
|
|
139
|
+
* `doneSelectEnrollProcess` - fires when the legacy "Reconnect or Add
|
|
140
|
+
new" select screen renders. The 0.8 view collapses that selection
|
|
141
|
+
into the carrier-tile list, so this fires once at mount and is
|
|
142
|
+
primarily kept for back-compat.
|
|
143
|
+
|
|
144
|
+
## See also
|
|
145
|
+
|
|
146
|
+
* [Theme](./theme.md) for branding the SDK shell (the status badges
|
|
147
|
+
use semantic colors that aren't affected by `theme.primaryColor`)
|
|
148
|
+
* [Connect Access Token](./connect-access-token.md) for the security
|
|
149
|
+
setup member-portal mode requires
|
|
150
|
+
* [SDK Flow](./sdk-flow.md) for the broader step machine the
|
|
151
|
+
fix-credentials view plugs into
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/docs/headless.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Headless mode — drive every step yourself
|
|
2
|
+
|
|
3
|
+
The default `stream-connect-sdk` bundle ships with a complete Plaid-Link-style UI: a stepped wizard, a choose-carrier tile grid, a credentials form, an end widget, and a floating validation hero / corner panel. For most integrators that's exactly what you want — drop in a `<div id="...">`, call `StreamConnect({ el, ...identity })`, done.
|
|
4
|
+
|
|
5
|
+
Some integrators want something different. They have a design system the SDK chrome doesn't match. They want the SDK invisible — just the data pipe — so they can render the carrier picker, the credentials form, and the end screen with their own components. The 0.8 SDK supports this in two pieces: the existing `renderXxx: false` callback contract, plus a separate **headless bundle** that ships without our stylesheet.
|
|
6
|
+
|
|
7
|
+
## When to use the headless bundle
|
|
8
|
+
|
|
9
|
+
| Use headless when... | Use the default (styled) bundle when... |
|
|
10
|
+
|---|---|
|
|
11
|
+
| You drive every step (choose-carrier, credentials form, end screen) with your own React/Vue/whatever components and only need the SDK for the data flow. | You want the built-in widgets. The 50 KB of Tailwind output is a fair trade for "drop in and it works." |
|
|
12
|
+
| Your host page has its own styling system and our `tpa-*` utility classes are unwanted dead bytes. | You want a design that auto-themes from your brand color via `theme.primaryColor`. |
|
|
13
|
+
| You're shipping the SDK on a bandwidth-sensitive page (mobile, embedded). | You don't have a design team building custom UI for the connect flow. |
|
|
14
|
+
| You want full control over mobile / responsive behavior. | You're OK with the default layout. |
|
|
15
|
+
|
|
16
|
+
The headless bundle does NOT change the SDK's behavior — same auth, same SSE-driven validation, same 2FA flow, same backend contract. It only changes whether `tailwind.css` is bundled.
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install stream-connect-sdk@^0.8
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Both bundles ship in the same package; pick at import time:
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
// Styled (default) — built-in widgets render with their full chrome.
|
|
28
|
+
import StreamConnect from 'stream-connect-sdk';
|
|
29
|
+
|
|
30
|
+
// Headless — same StreamConnect function, no stylesheet bundled.
|
|
31
|
+
import StreamConnect from 'stream-connect-sdk/headless';
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Headless init recipe
|
|
35
|
+
|
|
36
|
+
```js
|
|
37
|
+
import StreamConnect from 'stream-connect-sdk/headless';
|
|
38
|
+
|
|
39
|
+
StreamConnect({
|
|
40
|
+
el: '#sdk-mount',
|
|
41
|
+
apiToken: '...',
|
|
42
|
+
tenant: { systemKey: 'YOUR_TENANT_KEY', vendor: 'internal' },
|
|
43
|
+
employer: { systemKey: '...', vendor: 'internal', name: '...' },
|
|
44
|
+
user: { firstName: '...', lastName: '...', email: '...' },
|
|
45
|
+
|
|
46
|
+
// Skip the built-in renderers — your code handles the UI.
|
|
47
|
+
renderChoosePayer: false,
|
|
48
|
+
renderPayerForm: false,
|
|
49
|
+
renderEndWidget: false,
|
|
50
|
+
|
|
51
|
+
// Callbacks fire INSTEAD of the built-in widgets rendering.
|
|
52
|
+
doneChoosePayer: (payload) => {
|
|
53
|
+
// Render your own carrier picker. Call payload.choosePayer({ payer })
|
|
54
|
+
// to advance to the credentials step.
|
|
55
|
+
mountMyCarrierPicker(payload);
|
|
56
|
+
},
|
|
57
|
+
doneCreatedForm: (payload) => {
|
|
58
|
+
// Render your own credentials form. Call payload.validateCreds({ params })
|
|
59
|
+
// to submit. params must include payer_id + accept + tenants_accept;
|
|
60
|
+
// see assets/sdk/components/EnterCredentials.tsx for the canonical shape.
|
|
61
|
+
mountMyCredsForm(payload);
|
|
62
|
+
},
|
|
63
|
+
doneEasyEnroll: (payload) => {
|
|
64
|
+
// Final terminal event after validation completes. payload includes
|
|
65
|
+
// policyHolder, payer, employer, tenant, user, credentialsValid,
|
|
66
|
+
// endingMessage, pending.
|
|
67
|
+
mountMyEndScreen(payload);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## What's still mounted in headless mode
|
|
73
|
+
|
|
74
|
+
The SDK still mounts a React root at `el` because the renderXxx callbacks need a host React tree to live in. Two things render by default and are typically what customers want even in headless mode:
|
|
75
|
+
|
|
76
|
+
- **ActiveValidationsHero** — the inline 2FA prompt (method picker + code entry). When a validation needs 2FA, this card appears above your custom UI. It's the only way to gather the OTP from the user.
|
|
77
|
+
- **ActiveValidationsPanel** — the floating corner notification showing in-flight validations.
|
|
78
|
+
|
|
79
|
+
Both rely on the SDK's `tpa-*` utility classes. In the headless bundle those classes have no styles attached, so the elements render as unstyled divs and inputs. Two paths:
|
|
80
|
+
|
|
81
|
+
1. **Style them yourself.** The hero is `.tpa-sdk-root > [data-tpa-hero]`; the panel is `[data-tpa-panel]`. Style with your own CSS to match your design system.
|
|
82
|
+
2. **Hide them entirely** and provide your own 2FA UI. Subscribe to the same SSE stream the hero uses via... actually, this isn't currently exposed as a public API. If you need full 2FA control without the hero, file an issue — we'll plumb it.
|
|
83
|
+
|
|
84
|
+
The Terms-of-Use Dialog is mounted only when the user clicks "View Terms of Use" in your custom form (which calls `toggleTermsOfUse()` from the credentials callback payload). It uses the styled Dialog component; in headless mode it renders as an unstyled overlay. Style it via `.tpa-sdk-root [role="dialog"]` or pre-fetch the terms HTML yourself and render in your own modal.
|
|
85
|
+
|
|
86
|
+
## What's NOT in the headless bundle
|
|
87
|
+
|
|
88
|
+
- `tailwind.css` (the entire utility-class stylesheet) — about 27 KiB minified.
|
|
89
|
+
|
|
90
|
+
That's it. Every component, every reducer, every API client, every type — all identical between bundles. The split is purely about whether the stylesheet is imported.
|
|
91
|
+
|
|
92
|
+
## Migrating from the styled to the headless bundle
|
|
93
|
+
|
|
94
|
+
If you're already using the default styled bundle with `renderChoosePayer: false` etc., switching to headless is one import line:
|
|
95
|
+
|
|
96
|
+
```diff
|
|
97
|
+
- import StreamConnect from 'stream-connect-sdk';
|
|
98
|
+
+ import StreamConnect from 'stream-connect-sdk/headless';
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
All your init options and callbacks keep working as-is. The only visual change is the SDK's chrome (hero, panel, dialog) lose their default styling — apply your own CSS or hide them per the section above.
|
|
102
|
+
|
|
103
|
+
## See also
|
|
104
|
+
|
|
105
|
+
- [Client usage](./client-usage.md) — full options reference + the `renderChoosePayer` / `renderPayerForm` / `renderEndWidget` flags.
|
|
106
|
+
- [SDK flow](./sdk-flow.md) — the step machine you're driving callbacks for.
|
|
107
|
+
- [Two-factor authentication](./two-factor.md) — what the hero is rendering when a validation needs MFA.
|
|
Binary file
|
|
Binary file
|
package/docs/interop.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Patient Access API (Interop)
|
|
2
|
+
|
|
3
|
+
TPAStream supports carrier Patient Access APIs for SDK users. Instead of collecting carrier credentials inline, the user authenticates on the carrier's own website and TPAStream receives a 90-day access token that it uses to harvest the data. The init option that enables this flow is **`enablePatientAccessAPI`**.
|
|
4
|
+
|
|
5
|
+
> Renamed in 0.8. The option was originally called `enableInterop`; both names still work indefinitely. Passing `enableInterop` logs a one-time console deprecation warning but otherwise behaves identically. New integrations should use the canonical name.
|
|
6
|
+
|
|
7
|
+
## Client Usage
|
|
8
|
+
When `enablePatientAccessAPI` is set and your tenant / token is configured within TPAStream as Patient Access API-compliant, the SDK exposes payers that authenticate via a redirect to the payer website instead of an inline credentials form.
|
|
9
|
+
|
|
10
|
+
Here's how the flow goes at a top level:
|
|
11
|
+
|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
As shown above, the user is sent to a new window on the payer's website, completes authentication there, and the SDK detects the connection back to TPAStream and continues normally.
|
|
15
|
+
|
|
16
|
+
## Single-page variant
|
|
17
|
+
|
|
18
|
+
Pass **`enablePatientAccessAPISinglePage`** instead of (or in addition to) `enablePatientAccessAPI` to perform the redirect in the current tab rather than opening a new window. When both are set, single-page wins.
|
|
19
|
+
|
|
20
|
+
The legacy alias `enableInteropSinglePage` is also still accepted with the same deprecation-warning treatment.
|
|
21
|
+
|
|
22
|
+
## Redirect query parameters
|
|
23
|
+
|
|
24
|
+
After the carrier redirect completes, the SDK reads two URL parameters automatically on load:
|
|
25
|
+
|
|
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.
|
|
28
|
+
|
|
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
|
+
|
|
31
|
+
## See also
|
|
32
|
+
|
|
33
|
+
* [Connect Access Token](./connect-access-token.md): how the
|
|
34
|
+
`?accessToken=` minting fits into the broader connect-token security
|
|
35
|
+
model
|
|
36
|
+
* [Fix Credentials](./fix-credentials.md): Patient Access API carriers
|
|
37
|
+
show up in the same fix-credentials list with the same status badges
|
|
38
|
+
as inline-credential carriers
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Migrating from 0.7.x to 0.8
|
|
2
|
+
|
|
3
|
+
The 0.8 release is **backward-compatible** with 0.7.x at the `init()` call site: every option supported in 0.7.7 keeps working, including the custom render props (`renderChoosePayer`, `renderPayerForm`, `renderEndWidget`), all `done*` callbacks, `theme` (new), `userSchema` (changed, see below), and the rest.
|
|
4
|
+
|
|
5
|
+
If you do nothing, the 0.8 SDK will run with your existing 0.7.x init object. The visible changes are the new default appearance and the SSE-backed validation UI. This document calls out the handful of cases where a no-op upgrade is *not* what you want.
|
|
6
|
+
|
|
7
|
+
## What changed
|
|
8
|
+
|
|
9
|
+
### Look and feel
|
|
10
|
+
- Polished default appearance: cards, generous whitespace, system-font stack, accessible focus rings. No host-page CSS required; the SDK is visually self-contained.
|
|
11
|
+
- New `theme.primaryColor` init option recolors buttons, links, focus rings, and progress bars. See [Theme](./theme.md).
|
|
12
|
+
|
|
13
|
+
### Stack
|
|
14
|
+
- React 19, full TypeScript port.
|
|
15
|
+
- Tailwind utility classes with the `tpa-` prefix to avoid name collisions with host-page CSS. The reset and theme variables are scoped under `.tpa-sdk-root` so they only affect the SDK subtree; the utility classes themselves are global but prefixed, so they only apply where the prefixed class names appear in the DOM.
|
|
16
|
+
- Headless UI primitives for accessible Dialog and Combobox.
|
|
17
|
+
- React Hook Form + Zod for the carrier credential form.
|
|
18
|
+
- **Removed dependencies**: `@fortawesome/*`, `font-awesome`, `react-jsonschema-form`, `react-popup`, `react-select`, `react-highlight-words`, `query-string`, `@babel/polyfill`, `regenerator-runtime`.
|
|
19
|
+
|
|
20
|
+
### Credential validation
|
|
21
|
+
- Server-Sent Events stream replaces polling. State transitions arrive as they happen instead of on a 5-second cadence.
|
|
22
|
+
- Backed by the new `/v3/sdk/progress/<task_id>/stream` endpoint. Auth is a short-lived task-scoped JWT (audience `sdk:sse:progress`, bound to the user + task, 10-minute TTL) returned in the credential-submit response as `task_token` and forwarded as a `?token=...` query param on the SSE subscription.
|
|
23
|
+
- Multiple validations can run in parallel; each owns its own SSE subscription.
|
|
24
|
+
- Validation now renders in a non-blocking hero element + corner panel rather than blocking the carrier picker.
|
|
25
|
+
|
|
26
|
+
### `init()` options
|
|
27
|
+
- `realTimeVerification` default is unchanged from 0.7.7 (still `true`). The transport changed; the default did not.
|
|
28
|
+
- `enableInterop` -> `enablePatientAccessAPI`. Legacy name keeps working; using it logs a one-time console deprecation warning.
|
|
29
|
+
- `enableInteropSinglePage` -> `enablePatientAccessAPISinglePage`. Same deprecation treatment.
|
|
30
|
+
- **New**: `theme` / `theme.primaryColor`.
|
|
31
|
+
- **New**: `enablePatientAccessAPI`, `enablePatientAccessAPISinglePage`.
|
|
32
|
+
|
|
33
|
+
## Things to double-check
|
|
34
|
+
|
|
35
|
+
### 1. Drop the Bootstrap CSS link (optional)
|
|
36
|
+
|
|
37
|
+
The 0.7.x quickstart told integrators to load Bootstrap 4.3 in the host page. The 0.8 SDK does not require it; you can remove the `<link rel="stylesheet" href=".../bootstrap.min.css">` tag. Host pages that already load Bootstrap for their own reasons can keep doing so without conflict: SDK utility classes use the `tpa-` prefix so collisions with host CSS are by-construction unlikely, and the reset + theme variables are wrapped under `.tpa-sdk-root` so they only affect the SDK subtree. The utility classes themselves are global by construction (anywhere `.tpa-text-white` appears in the DOM, the rule applies), but the prefix is what prevents them from colliding with host CSS.
|
|
38
|
+
|
|
39
|
+
### 2. `userSchema` no longer drives form rendering
|
|
40
|
+
|
|
41
|
+
In 0.7.x, `userSchema` was a [react-jsonschema-form](https://react-jsonschema-form.readthedocs.io/) UI-schema object that customized the credentials form layout. `react-jsonschema-form` was removed in 0.8 to cut bundle size.
|
|
42
|
+
|
|
43
|
+
`userSchema` is still accepted as an init option for back-compat:
|
|
44
|
+
- It is forwarded into the credential-submit payload (your backend can read it if you need to).
|
|
45
|
+
- It no longer affects the form's visual rendering.
|
|
46
|
+
- The SDK logs a one-time console warning if it sees a non-empty `userSchema`.
|
|
47
|
+
|
|
48
|
+
If you depended on UI-schema-driven extra fields in 0.7.x, please file an issue at https://github.com/TPAStream/stream-connect-js-sdk/issues so we can scope an alternative.
|
|
49
|
+
|
|
50
|
+
### 3. `realTimeVerification` behavior is different
|
|
51
|
+
|
|
52
|
+
The default is still `true`. What changed:
|
|
53
|
+
- The transport is now SSE instead of a 5-second polling loop.
|
|
54
|
+
- The validation UI is now **non-blocking**. The user can continue interacting with the SDK while validation streams in the corner panel, rather than being held on a loading screen for up to 200 seconds.
|
|
55
|
+
- MFA prompts render in the floating validation hero (a card at the top of the SDK root), NOT inside the credentials form. After submit, the user is returned to the picker or fix-credentials list and the hero shows the method picker / code entry inline. The credentials form itself stays out of the MFA flow.
|
|
56
|
+
|
|
57
|
+
If you previously omitted `realTimeVerification` and relied on the blocking, polling-based behavior, you have two choices:
|
|
58
|
+
- **Recommended**: leave the default `true`. The non-blocking UI is the same fidelity of feedback, just nicer.
|
|
59
|
+
- **Preserve 0.7.x submit-and-trust**: pass `realTimeVerification: false` explicitly. The SDK will not display validation feedback or MFA prompts; submitted credentials are treated as accepted and the flow advances immediately.
|
|
60
|
+
|
|
61
|
+
### 4. `realtimeTimeout` is a no-op
|
|
62
|
+
|
|
63
|
+
In 0.7.x this set the polling-loop timeout. In 0.8 the timeout is server-side (~10 minutes on the SSE stream) and `realtimeTimeout` is accepted but ignored. You can leave the option in place or remove it; either is fine.
|
|
64
|
+
|
|
65
|
+
### 5. `fixCredentials` is deprecated
|
|
66
|
+
|
|
67
|
+
If your integration passes `fixCredentials: true` alongside a `connectAccessToken`, drop the `fixCredentials` line. The SDK now derives member-portal mode automatically from the presence of `connectAccessToken` (which was always a hard backend requirement for the fix-credentials endpoint, so the flag was redundant). The 0.8 SDK still accepts `fixCredentials` for back-compat and logs a one-time `console.warn` reminding you to remove it.
|
|
68
|
+
|
|
69
|
+
If you were passing `fixCredentials: true` *without* a `connectAccessToken`, the behavior has changed: 0.7.x surfaced a configuration error on init ("You must have a connect access token enabled..."); 0.8 drops that check and falls through to the standard choose-payer enrollment flow. The backend `/sdk-api/fix-credentials` endpoint still requires the token, so member-portal mode itself is unreachable without it, but the SDK won't error at init anymore. If your integration was relying on that error to surface a misconfiguration, set up a server-side check that `connectAccessToken` is non-empty before passing the init payload to the SDK.
|
|
70
|
+
|
|
71
|
+
### 6. Rename `enableInterop` (no rush)
|
|
72
|
+
|
|
73
|
+
The legacy aliases keep working indefinitely; one-time console warning when set. Rename at your convenience:
|
|
74
|
+
|
|
75
|
+
| 0.7.x | 0.8 canonical |
|
|
76
|
+
|---|---|
|
|
77
|
+
| `enableInterop` | `enablePatientAccessAPI` |
|
|
78
|
+
| `enableInteropSinglePage` | `enablePatientAccessAPISinglePage` |
|
|
79
|
+
|
|
80
|
+
### 7. `enablePatientAccessAPI` default flipped to `true`
|
|
81
|
+
|
|
82
|
+
**Behavior change**, opt-out only. In 0.7.x, Patient Access API routing was off by default; integrators had to pass `enableInterop: true` (or `enablePatientAccessAPI: true` in 0.8 canonical) to make PAA-routed payers like Anthem, UHC Interop, Kaiser Interop, and Empire BCBS API take the OAuth-popup branch. Without the flag, those payers fell through to rendering the raw `interoperability.OnBoard` schema, which exposes `interoperability_refresh_token` as a user-visible text input — meaningless to a real user since the OAuth callback is what populates that field server-side.
|
|
83
|
+
|
|
84
|
+
In 0.8 the default is `true`. If you weren't passing `enableInterop: true` / `enablePatientAccessAPI: true`, your PAA payers were almost certainly broken in 0.7.x (no user knows what to put in the refresh-token field) and start working in 0.8 with no action on your part.
|
|
85
|
+
|
|
86
|
+
If you deliberately want the legacy fallthrough behavior — e.g. you're doing custom PAA orchestration and want the SDK out of the way — pass `enablePatientAccessAPI: false` explicitly. The legacy `enableInterop: false` alias also continues to honor the opt-out.
|
|
87
|
+
|
|
88
|
+
`enablePatientAccessAPISinglePage` is unchanged at `false` by default. Single-page mode replaces the OAuth popup with a full host-page redirect; defaulting it on would silently lose host-page state for popup-flow customers, so customers explicitly opt in.
|
|
89
|
+
|
|
90
|
+
### 8. Custom render props: data shapes unchanged
|
|
91
|
+
|
|
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
|
+
|
|
94
|
+
## What you do NOT need to do
|
|
95
|
+
|
|
96
|
+
- You do not need to add a `theme` option. The default appearance applies automatically.
|
|
97
|
+
- You do not need to rename `apiToken` / `sdkToken`. Both still work.
|
|
98
|
+
- You do not need to install React or React-DOM. The SDK bundles its own React 19.
|
|
99
|
+
- You do not need to handle `task_token` yourself. The SDK uses it internally for the SSE subscription.
|
|
100
|
+
- You do not need to consume `?accessToken=...` or `?forceTPAStreamSdkEnd=1` URL parameters yourself. The SDK reads them on init and strips them via `history.replaceState`.
|
|
101
|
+
|
|
102
|
+
## 0.7.x remains supported
|
|
103
|
+
|
|
104
|
+
If you are not ready to upgrade, the CDN keeps every pinned version available indefinitely. Pin to the last 0.7.x:
|
|
105
|
+
|
|
106
|
+
```html
|
|
107
|
+
<script src="https://app.tpastream.com/static/js/sdk-v-0.7.7.js"></script>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Open an issue if a 0.7.x bugfix backport is needed for a customer who cannot move yet.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|