Navigation

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-sdk
yarn add @billerapi/connect-sdk
pnpm add @billerapi/connect-sdk

Quick 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

OptionTypeDescription
linkToken*stringLink token from POST /link/token/create
onSuccess*functionCalled with (publicToken, metadata) when user completes linking
onExitfunctionCalled with (error, metadata) when user exits or an error occurs
onEventfunctionCalled with (eventName, metadata) for tracking

Events

EventDescription
OPENConnect flow opened
SELECT_BILLERUser selected a biller
SUBMIT_CREDENTIALSUser submitted credentials
MFA_REQUIREDMFA step presented
SUBMIT_MFAUser submitted MFA response
ACCOUNT_DISCOVEREDAccount discovered and linked
SUCCESSFlow completed successfully
EXITUser exited the flow
ERRORAn error occurred