Loading...
Loading...
For full control over your experience, Quiltt exposes a JavaScript API to programmatically interact with the Connector.
Documentation
The JavaScript API is written in TypeScript and is fully typed. The complete TypeScript interface is available on Github.
The Connector emits a number of events that can be used to customize the user experience and integrate with your application.
Event Type | Value | Description |
---|---|---|
Load | "loaded" | The Connector has loaded successfully. |
Open | "opened" | The Connector modal has been opened. |
ExitSuccess | "exited.successful" | The end-user has successfully completed the flow. |
ExitAbort | "exited.aborted" | The end-user closed the Connector before completing the flow. |
ExitError | "exited.errored" | The end-user experienced an error during the flow. |
All events will return a Metadata object with the following data:
Property | Required | Type | Description |
---|---|---|---|
connectorId | Yes | string | The ID of the Connector emitting the event. |
profileId | No | string | The ID of the Profile using the Connector. |
connectionId | No | string | The ID of the succesfully created or updated Connection. |
To handle these events in your application, you can attach the appropriate callback functions to your Connector instance. See the HTML5 and React guides for more information.
Callback | Arguments | Description |
---|---|---|
OnEvent | eventType , metadata | Called on all events. |
OnExit | eventType , metadata | Called on all Exit events. |
OnOpen | metadata | Called on the Open event. |
OnLoad | metadata | Called on the Load event. |
OnExitSuccess | metadata | Called on the ExitSuccess event. |
OnExitAbort | metadata | Called on the ExitAbort event. |
OnExitError | metadata | Called on the ExitError event. |
The below methods are called on the global Quiltt object.
Quiltt.authenticate()
Authenticate an end-user for the Connector. You can generate a Session token using the Auth API or in the Quiltt Dashboard. See the Issuing Session Tokens guide for more information.
Quiltt.connect()
This method allows you to initialize a Connector instance by passing in the Connector ID, and optionally, a search term to target an Institution. You can also pass in callbacks for various events.
Quiltt.reconnect()
This methods allows you to repair or reconnect an existing Connection using the Reconnect Flow. See the Reconnect Flow guide for more information.
Callbacks can be registered globally on the Quiltt
object, or on a specific Connector instance.
onEvent()
This method allows you to subscribe to all Connector events. All events will return a Metadata object with additional context.
onOpen()
This method allows you to pass a callback for the loaded
event.
onLoad()
This method allows you to pass a callback for the loaded
event.
onExit()
This method allows you to pass a callback for all exited
events.
onExitAbort()
This method allows you to pass a callback for the exited.aborted
event.
onExitError()
This method allows you to pass a callback for the exited.errored
event.
onExitSuccess()
This method allows you to pass a callback for the exited.success
event.
The complete list of functions, types and event callbacks is available on GitHub.
You can also import the typings from the @quiltt/core
package. For example, to get typings for the onExitSuccess
event: