Skip to main content

Installing the Benji Connect SDK

The Benji Connect SDK can be added to your application by including the SDK script in your HTML head.
or by installing the package via npm
or by installing the package via yarn
or by installing the package via pnpm
Note that you will be able to access the above packages/scripts once authorized to use the Benji SDKs. Contact your account manager for additional info.

How the Benji Connect SDK loads Connect

When you call open(), the Benji Connect SDK creates a modal overlay and loads the Connect experience inside it.

Initializing the Benji Connect SDK

The Benji Connect SDK is initialized with the following parameters:
string
required
Environment for the Connect flow: development | sandbox | production.
string
required
Connect token from the Create Token API.
callback function
Called when the flow completes successfully (FLOW_SUCCESS). Receives the exchange token and metadata.
callback function
Called when the user leaves the Connect UI (FLOW_EXIT), whether or not onSuccess ran.
callback function
Called when an error is reported from the Connect flow (ERROR).
callback function
Called for mid-flow and auxiliary events (e.g. AUTH_SUCCESS). See Methods & Events.
Types are optional. The same runtime behavior applies to JavaScript and TypeScript; TypeScript users can import types from @benji-money/connect-sdk for autocomplete.
To open the UI after initialization, call await sdk.open() (see Methods & Events).