Connect SDK Reference
JavaScript SDK for embedding the BillerAPI account linking flow in your frontend.
For a step-by-step integration guide, see Embed Connect SDK.
Installation
npm install @billerapi/connect-sdkyarn add @billerapi/connect-sdkpnpm add @billerapi/connect-sdkQuick Start
JavaScript
import { BillButler } from '@billerapi/connect-sdk';
const connect = new BillButler({
linkToken: 'lt_xxx', // from POST /link/token/create
onSuccess: (publicToken, metadata) => {
// Exchange publicToken on your server
// POST /link/token/exchange
console.log('Linked!', metadata.biller_id);
},
onExit: (error, metadata) => {
if (error) console.error('Link failed:', error);
},
onEvent: (event, metadata) => {
console.log('Event:', event);
},
});
connect.open();Configuration
| Option | Type | Description |
|---|---|---|
| linkToken* | string | Link token from POST /link/token/create |
| onSuccess* | function | Called with (publicToken, metadata) when user completes linking |
| onExit | function | Called with (error, metadata) when user exits or an error occurs |
| onEvent | function | Called with (eventName, metadata) for tracking |
Events
| Event | Description |
|---|---|
| OPEN | Connect flow opened |
| SELECT_BILLER | User selected a biller |
| SUBMIT_CREDENTIALS | User submitted credentials |
| MFA_REQUIRED | MFA step presented |
| SUBMIT_MFA | User submitted MFA response |
| ACCOUNT_DISCOVERED | Account discovered and linked |
| SUCCESS | Flow completed successfully |
| EXIT | User exited the flow |
| ERROR | An error occurred |