TPA Stream Connect
Client Library

Usage

Our JavaScript Client Library is designed to allow users of your Web or Mobile application to connect their Health Insurance accounts with your Application.

To get up and running, you can simply copy and paste the JavaScript snippets below, and run it in isDemo mode today. You can use the provided callbacks to customize the look, feel, and overall experience for your users.

Detailed Client-Usage Docs

We highly suggest taking a look at our Detailed Client-Usage Docs on github while attempting to implement the SDK.

Quickstart

Clicking on this card brings you to the quickstart page

FAQ

Clicking on this card brings you to the FAQ page

Error Documentation

Clicking on this card brings you to the Error Documentation page

SDK Flow

Clicking on this card brings you to the SDK Flow page

JavaScript Client

Source Code

You can find the source code to our JavaScript Client here

npm i stream-connect-sdk
import StreamConnect from "stream-connect-sdk";

const sdk = StreamConnect({
  el: "#react-hook",
  isDemo: true,
});

CDN Example

<script src="https://app.tpastream.com/static/js/sdk.js"></script>
<script>
    window.StreamConnect({
        el: '#react-hook',
        tenant: {
            systemKey: 'test',
            vendor: 'internal'
        },
        employer: {
            systemKey: 'some-system-key',
            vendor: 'internal',
            name: 'some-name'
        },
        user: {
            firstName: 'Joe',
            lastName: 'Sajor',
            email: 'some-email@place.com',
            memberSystemKey: 'some-system-key',
            phoneNumber: '333333333',
            dateOfBirth: '11-11-1121'
        },
        apiToken: 'Some Provided Key → 21poi34kjqf21j1poi1d2po', // We'll provide this.
        isDemo: false,
        realTimeVerification: true,
        renderChoosePayer: true,
        doneGetSDK: ({ user, payers, tenant, employer }) => {},
        doneChoosePayer: ({ choosePayer, streamPayers }) => {},
        doneTermsOfService: () => {},
        doneCreatedForm: () => {},
        donePostCredentials: ({ params }) => {},
        doneRealTime: () => {},
        donePopUp: () => {},
        doneEasyEnroll: ({ employer, payer, tenant, policyHolder, user }) => {},
        handleFormErrors: (error, {response, request, config}) => {},
        userSchema: {}
    })
</script>

As of SDK version 0.4.7 the CDN provider is now versioned and will support up to 10 minor versions behind.

  • Importing the various versions of the SDK is handled in src attribute on your script tag
    • https://app.tpastream.com/static/js/sdk.js Grabs the latest version of the SDK
    • https://app.tpastream.com/static/js/sdk-v-<VersionNumber>.js For a specific version. Examples below.
      • https://app.tpastream.com/static/js/sdk-v-0.4.7.js

SDK Client Usage Docs

We highly suggest taking a look at our Detailed Client-Usage Docs on github while attempting to implement the SDK.

There you will find explanations for all of the various callbacks in the example above as well as explanations for the various configuration paramters.

Android Example

In Android, you can implement the JavaScript SDK by creating an html file in your assets folder that loads the SDK, then loading it in a WebView. Here’s a simple example implementation in Java.

public class ViewWeb extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.content);
        WebView webview = (WebView) findViewById(R.id.webView);
        webview.loadUrl("file:///android_asset/stream-connect.html");
    }
}

iOS Example

In iOS, you can implement the JavaScript SDK by creating a directory in your project (“stream-connect” in the below example), and putting an html file in it (index.html in the below example) that loads the SDK. You can then load it into a WKWebView. Here’s a simple example implementation in Objective-C.

import UIKit
import WebKit

class ViewController: UIViewController, WKUIDelegate, WKNavigationDelegate {

    @IBOutlet weak var webView: WKWebView!
    override func viewDidLoad() {
        super.viewDidLoad()
        webView.uiDelegate = self
        webView.navigationDelegate = self
        let url = Bundle.main.url(forResource: "index", withExtension: "html", subdirectory: "stream-connect")!
        webView.loadFileURL(url, allowingReadAccessTo: url)
        let request = URLRequest(url: url)
        webView.load(request)
    }
}

Change Log

v0.4.8 (Latest)

  • Add individual endpoints for the following: payer and terms of service
  • Seperate the versions of the api and create a version manager.
  • Drastically improve initial endpoint loadtime by bringing down less info.

v0.4.7

  • Add versioning to the CDN provider
  • Append version to all request headers for underlying api to read.

Example Crawl Webhook JSON Request

{
  "data": {
    "members": [
      {
        "id": 63167
      }
    ],
    "policy_holder": {
      "id": 189162,
      "login_correction_message": "The login information you provided for Anthem is invalid. Please re-enter your login information.",
      "login_problem": "invalid"
    },
    "success": false
  }
}