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.

Overview
The Benji Connect SDK is a JavaScript/TypeScript library that opens a modal to the Benji Connect experience. After your user completes the flow, you receive a short-lived token to exchange for API access, plus structured metadata about the user and any transaction context. Connect modes (what the user is doing in the UI—link account, transfer points, redeem points) are determined by the connect token you create on your server (mode and optional custom_attributes). See Connect modes for values and usage. That is separate from your partnership type in Pilot (e.g. Direct vs Marketplace), which describes how the partnership is sourced.
Benji Connect flow
- Create a connect token on your server (
partnership_id,mode, optionaluser_external_id, optionalcustom_attributes, etc.). - Initialize the Benji Connect SDK with that token, your environment (
development|sandbox|production), and optional callbacks (onSuccess,onError,onExit,onEvent). - Call
open()when the user starts Connect (e.g. button click). The Benji Connect SDK presents the Connect flow in that modal; the Connect URL includes your token asconnect_token(same idea as Benji Hosted Connect query parameters). - Handle callbacks: completion and errors are described in the Methods & Events page (
onSuccessreceives the exchange token afterFLOW_SUCCESS). - (Optional) Exchange the token from
onSuccessfor long-livedaccess_token/refresh_tokenpairs for user-scoped Benji APIs.