This documentation is for Stitch.js (v3) SDK, which is now the recommended version for integrating Fasten Connect into your application.
If you need access to the previous version, please see the v1 documentation.This version includes a new API, compatibility with additional frontend frameworks (Next.js, React, Native, etc), improved performance, and additional features.v3 also introduces a number of breaking changes. Please see v3/update-guide for more information.The v1 Web Component is in maintenance mode and will no longer receive updates (outside of security fixes).
Please update your code to use the new version.
This must be your API public ID. You can find it in your Fasten Connect Portal.
(Optional) Useful when the patient connection credentials are invalid (due to expiration or revocation). Providing this
reconnect-org-connection-id
allows Fasten to reauthenticate the Patient and store their new credentials.(Optional) An Opaque identifier, used to identify the patient in your system. This value will be returned in the response.
(Optional) If set to
true
, the stitch component will only show the search box and will not prompt the patient to verify their email address.(Optional) Prepopulate the search box with a query.
(Optional) Show a splash page introduces Fasten Connect and displays your privacy policy & terms to the patient before they begin the connection process.
(Optional) If set to
true
, the stitch component will not close when the user clicks outside of the modal.
This is useful for cases where you want to keep the modal open until the user explicitly closes it.(Optional) By default the following standard events are always emitted:
patient.connection_pending
patient.connection_success
patient.connection_failed
widget.complete
.
event-types
parameter to a comma-separated list of event types.search.query
: This event is emitted when the patient searches for a healthcare institution in the Fasten Connect catalog.
Events
Unlike the previous version of the stitch component, the new version does not support
redirect
mode.addEventListener()
).
patient.connection_pending
This event is emitted when the patient has begun the process to connect and the popup window has closed.Endpoint Id is a unique identifier for the endpoint that the patient has connected to.
This value can be used to retrieve metadata about the endpoint (e.g. name, description, endpoint url information, etc.)
Portal Id is a unique identifier for the Portal that the patient has connected to.
This value can be used to retrieve branding information about the institution
Brand Id is a unique identifier for the Brand that the patient has connected to.
This value can be used to retrieve branding information about the institution
Organization Connection Id is a unique identifier for the connection between the patient and the organization.
You must store this value in your system to identify the patient in future API calls.
(Optional) An Opaque identifier, used to identify the patient in your system.
This value will be only be returned if it was previously provided to the stitch html element.
(Optional) An Opaque identifier, used to identify the connection request.
This value will be only be returned if it was previously provided to the stitch html element.
patient.connection_success
This event is emitted when the patient has successfully connected to a single health system.In most cases you’ll want to listen to the
widget.complete
event instead of this one, as it will contain all the successful connections in a single event.Organization Connection Id is a unique identifier for the connection between the patient and the organization.
You must store this value in your system to identify the patient in future API calls.
Endpoint Id is a unique identifier for the endpoint that the patient has connected to.
This value can be used to retrieve metadata about the endpoint (e.g. name, description, endpoint url information, etc.)
Portal Id is a unique identifier for the Portal that the patient has connected to.
This value can be used to retrieve branding information about the institution
Brand Id is a unique identifier for the Brand that the patient has connected to.
This value can be used to retrieve branding information about the institution
The status of the connection. Possible values are
authorized
, rejected
.An identifier for the EHR type associated with the connected endpoint.
An correlation id. This should be sent with any support ticket queries to the Fasten Connect support team.
patient.connection_failed
This event is emitted when an error occurred while the patient attempted to connect to their health system. The popup window has closed.Endpoint Id is a unique identifier for the endpoint that the patient has connected to.
This value can be used to retrieve metadata about the endpoint (e.g. name, description, endpoint url information, etc.)
Portal Id is a unique identifier for the Portal that the patient has connected to.
This value can be used to retrieve branding information about the institution
Brand Id is a unique identifier for the Brand that the patient has connected to.
This value can be used to retrieve branding information about the institution
The status of the connection. Possible values are
authorized
, rejected
.An identifier for the EHR type associated with the connected endpoint.
Every error will have a unique
request_id
. When communicating with the Fasten Health development team, please
provide the request_id
, as it will make the debugging process much easier.The
error
parameter will contain a short string representing the error that occurred.For errors that occurred on the health system side, the possible values are:invalid_client
invalid_grant
unauthorized_client
unsupported_grant_type
invalid_scope
fasten_unauthorized_client
fasten_invalid_request
fasten_server_error
fasten_token_exchange
The
error_description
parameter can only include ASCII characters, and will be a sentence or two at most describing the circumstance of the error.The
error_uri
is an optional url parameter that may contain a link to the EHR’s API documentation for more information.widget.complete
This event is emitted when the patient has finished connecting each healthcare institution and has closed the modal.data
field is an array of objects, each object representing a successful connection to a healthcare institution. See patient.connection_success
for the details of each object.
search.query (optional)
This event is emitted when the patient searches or a health care institution in the Fasten Connect catalog. This event is opt-in, and must be configured by setting theevent-types="search.query"
parameter to the stitch Web Component.
Javascript API
The stitch Web Component has a Javascript API that can be used to manipulate the modal popup.Methods
show()
Shows the modal popup.hide()
Hide the modal popup.Styling
Styling the stitch Web Component button is possible using CSS. You can target the component using the'fasten-stitch-element'
tag and select internal elements to apply custom styles.
!important
flag may be required to override the default styles.
The
fasten-stitch-element
is made up of a button, modal and iframe.
As such, you can target the button and modal elements to apply custom styles, but you will not be able to style any content within the iframe.Customizing Button Text
You can customize the text displayed on the “Share Records” button by adding your desired text between the opening and closing<fasten-stitch-element>
tags. For example:
Avoid using overly long text or HTML tags, as this may affect the button’s appearance and functionality.