Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.withbenji.com/llms.txt

Use this file to discover all available pages before exploring further.

Once initialized, the Benji Connect SDK exposes the methods below. User-driven outcomes are delivered through the callbacks you passed in the initialization step.

Methods

open()

Opens the Benji Connect UI in a modal. Call this after construction, typically from a button click or route handler.
document.getElementById('connectBtn').addEventListener('click', async (e) => {
  e.preventDefault();
  if (sdk) {
    await sdk.open();
  }
});

ping()

Returns the string 'pong'. Intended for quick debugging to verify the Benji Connect SDK bundle loaded; not required for production flows.

Events

Callbacks match the @benji-money/connect-sdk contract. Types below are exported as BenjiConnectEventType, BenjiConnectExitTrigger, and related interfaces for TypeScript users.

onSuccess

Fired when the Connect flow completes successfully (transport event FLOW_SUCCESS). This is the signal that the user finished link, transfer, or redeem as configured by the connect token (modes).

onExit

Fired when the user leaves the Connect UI (transport event FLOW_EXIT). The Benji Connect SDK closes the modal after this callback.

onEvent

Fired for mid-flow and auxiliary transport events. The first argument is type (BenjiConnectEventType).

onError

Fired when an error occurs in the Connect flow (ERROR transport event).