Overview of supported methods and events in the Benji Connect SDK
Once initialized, the Benji Connect SDK exposes the methods below. User-driven outcomes are delivered through the callbacks you passed in the initialization step.
Callbacks match the @benji-money/connect-sdk contract. Types below are exported as BenjiConnectEventType, BenjiConnectExitTrigger, and related interfaces for TypeScript users.
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).
Hide onSuccess
Arguments
token (string) — Short-lived exchange token. Use it with Exchange Token to obtain access and refresh tokens for user-scoped APIs. Exchange it promptly (see the Exchange Token page for validity).
metadata — Payload aligned with BenjiConnectOnSuccessMetadata:
context — SDK context (namespace, version).
action (optional) — One of connect, transfer, redeem (BenjiConnectAuthAction).
user_data (optional) — Structured user and status:
Fired for mid-flow and auxiliary transport events. The first argument is type (BenjiConnectEventType).
Hide onEvent
Arguments
type — Values you may see include:
AUTH_SUCCESS — Mid-flow authentication success. Delivered to onEvent only (not onSuccess). Use for progress or analytics; metadata can include action, user, and token-related fields.
EVENT — Generic events with additional fields in metadata.
Other values may be forwarded for forward compatibility.
metadata — Varies by type; always includes context. Additional keys are merged from the payload when present.
Routing (important):
FLOW_SUCCESS invokes onSuccess with the exchange token — not onEvent.
FLOW_EXIT invokes onExit — not onEvent.
ERROR invokes onError.
Practical distinction: Implement onSuccess for “flow completed + exchange token.” Use onEvent when you need mid-flow AUTH_SUCCESS or generic EVENT data before completion.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Benji","colors":{"primary":"#9900ff","light":"#07C983","dark":"#0D9373"},"logo":{"light":"https://mintcdn.com/benji/E3tFqos-Cc64Y5MH/logo/benji-docs-logo.svg?fit=max\u0026auto=format\u0026n=E3tFqos-Cc64Y5MH\u0026q=85\u0026s=60b7d848ffe4ab0c66efcfcbf573e3be","dark":"https://mintcdn.com/benji/E3tFqos-Cc64Y5MH/logo/benji-docs-logo.svg?fit=max\u0026auto=format\u0026n=E3tFqos-Cc64Y5MH\u0026q=85\u0026s=60b7d848ffe4ab0c66efcfcbf573e3be"},"favicon":"https://mintcdn.com/benji/E3tFqos-Cc64Y5MH/favicon.svg?fit=max\u0026auto=format\u0026n=E3tFqos-Cc64Y5MH\u0026q=85\u0026s=0d4db635c5349274277a1e3f4575d6c3","api":{"mdx":{"auth":{"method":"key","name":"x-api-key"},"server":["https://mintlify.com/api","https://mintlify.com/api2"]}},"appearance":{"default":"light","strict":true},"navbar":{"links":[{"href":"mailto:support@withbenji.com","label":"Support"}],"primary":{"type":"button","label":"Go to Pilot","href":"https://pilot-staging.withbenji.com/login"}},"footer":{"socials":{"website":"https://withbenji.com"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"benji","hasAudioNarration":false,"actualSubdomain":"benji","customDomains":["docs.withbenji.com"],"gitSource":{"type":"github","owner":"benji-money","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"feedback":{"thumbs":true,"issues":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6adfb18f141a85a6119e97a5","clientVersion":"0.0.4117","searchFilterCounts":[{"language":"default","tag":"Platform","count":13},{"language":"default","tag":"Benji Integrations","count":12},{"language":"default","tag":"Pilot","count":11},{"language":"default","tag":"API Reference","count":9},{"language":"default","tag":"Benji Connect","count":8},{"language":"default","tag":"Partnerships","count":5},{"language":"default","tag":"Benji Connect SDK","count":4},{"language":"default","tag":"Square","count":4},{"language":"default","tag":"Webhooks","count":3},{"language":"default","tag":"Getting Started","count":3}]},"assistantConfig":{},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"connect/methods","slug":"/connect/methods","pageMetadata":{"title":"Benji Connect SDK methods and events","description":"Overview of supported methods and events in the Benji Connect SDK","sidebarTitle":"Methods \u0026 Events","href":"/connect/methods"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Overview of supported methods and events in the Benji Connect SDK\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,Note}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Once initialized, the Benji Connect SDK exposes the methods below. User-driven outcomes are delivered through the callbacks you passed in the `,_jsx(_components.a,{href:`/connect/initialization`,children:`initialization`}),` step.`]}),`\n`,_jsx(Heading,{level:`2`,id:`methods`,children:`Methods`}),`\n`,_jsx(Heading,{level:`3`,id:`open`,children:`open()`}),`\n`,_jsx(_components.p,{children:`Opens the Benji Connect UI in a modal. Call this after construction, typically from a button click or route handler.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`document`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getElementById`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'connectBtn'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`addEventListener`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'click'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`e`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` e`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`preventDefault`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`sdk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` sdk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`open`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`ping`,children:`ping()`}),`\n`,_jsxs(_components.p,{children:[`Returns the string `,_jsx(_components.code,{children:`'pong'`}),`. Intended for quick debugging to verify the `,_jsx(_components.strong,{children:`Benji Connect SDK`}),` bundle loaded; not required for production flows.`]}),`\n`,_jsx(Heading,{level:`2`,id:`events`,children:`Events`}),`\n`,_jsxs(_components.p,{children:[`Callbacks match the `,_jsx(_components.code,{children:`@benji-money/connect-sdk`}),` contract. Types below are exported as `,_jsx(_components.code,{children:`BenjiConnectEventType`}),`, `,_jsx(_components.code,{children:`BenjiConnectExitTrigger`}),`, and related interfaces for TypeScript users.`]}),`\n`,_jsx(Heading,{level:`3`,id:`onsuccess`,children:`onSuccess`}),`\n`,_jsxs(_components.p,{children:[`Fired when the Connect `,_jsx(_components.strong,{children:`flow completes successfully`}),` (transport event `,_jsx(_components.code,{children:`FLOW_SUCCESS`}),`). This is the signal that the user finished link, transfer, or redeem as configured by the `,_jsx(_components.a,{href:`/connect/create_token`,children:`connect token`}),` (`,_jsx(_components.a,{href:`/connect/modes`,children:`modes`}),`).`]}),`\n`,_jsxs(Expandable,{title:`onSuccess`,defaultOpen:`true`,children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`Arguments`})}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`token`})}),` (`,_jsx(_components.code,{children:`string`}),`) — Short-lived `,_jsx(_components.strong,{children:`exchange`}),` token. Use it with `,_jsx(_components.a,{href:`/connect/exchange_token`,children:`Exchange Token`}),` to obtain access and refresh tokens for user-scoped APIs. Exchange it promptly (see the Exchange Token page for validity).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`metadata`})}),` — Payload aligned with `,_jsx(_components.code,{children:`BenjiConnectOnSuccessMetadata`}),`:`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`context`})}),` — SDK context (`,_jsx(_components.code,{children:`namespace`}),`, `,_jsx(_components.code,{children:`version`}),`).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`action`})}),` (optional) — One of `,_jsx(_components.code,{children:`connect`}),`, `,_jsx(_components.code,{children:`transfer`}),`, `,_jsx(_components.code,{children:`redeem`}),` (`,_jsx(_components.code,{children:`BenjiConnectAuthAction`}),`).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`user_data`})}),` (optional) — Structured user and status:`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`user`})}),`: `,_jsx(_components.code,{children:`id`}),`, `,_jsx(_components.code,{children:`first_name`}),`, `,_jsx(_components.code,{children:`last_name`}),`, optional `,_jsx(_components.code,{children:`uuid`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`status`})}),`: `,_jsx(_components.code,{children:`status_id`}),`, `,_jsx(_components.code,{children:`num_of_rewards`}),`, `,_jsx(_components.code,{children:`reward_status`}),`, optional `,_jsx(_components.code,{children:`partner_status_tier_id`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`extra_data`})}),` (optional): e.g. totals, dates`]}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`transaction_data`})}),` (optional) — When applicable: `,_jsx(_components.code,{children:`action`}),`, `,_jsx(_components.code,{children:`amount`}),`, `,_jsx(_components.code,{children:`trigger_event_id`}),`, `,_jsx(_components.code,{children:`trigger_name`})]}),`\n`]}),`\n`]}),`\n`]}),_jsx(_components.p,{children:`Example shape (illustrative):`}),_jsx(CodeBlock,{filename:``,numberOfLines:`23`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`23`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"context\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"namespace\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"benji-connect-sdk\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"version\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"1.0.0\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"action\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"connect\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"user_data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"user\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`12345`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"first_name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Test\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"last_name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"User\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"uuid\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"550e8400-e29b-41d4-a716-446655440000\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"status_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"********4156\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"num_of_rewards\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`45000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"reward_status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Mosaic 1\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"transaction_data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"action\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"redeem\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"amount\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"trigger_event_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"abc-123\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"trigger_name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"connect\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`3`,id:`onexit`,children:`onExit`}),`\n`,_jsxs(_components.p,{children:[`Fired when the user leaves the Connect UI (transport event `,_jsx(_components.code,{children:`FLOW_EXIT`}),`). The `,_jsx(_components.strong,{children:`Benji Connect SDK`}),` closes the modal after this callback.`]}),`\n`,_jsxs(Expandable,{title:`onExit`,defaultOpen:`true`,children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`Arguments`})}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`metadata`})}),` — `,_jsx(_components.code,{children:`BenjiConnectOnExitMetadata`}),`:`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.strong,{children:_jsx(_components.code,{children:`context`})})}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`trigger`})}),` — Why the UI closed (`,_jsx(_components.code,{children:`BenjiConnectExitTrigger`}),`):`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`ACTION_BUTTON_CLICKED`})}),` — User completed the flow and used the primary dismiss/action control.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`CLOSE_BUTTON_CLICKED`})}),` — User closed via the chrome close control.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`TAPPED_OUT_OF_BOUNDS`})}),` — User dismissed by tapping outside the modal (when supported).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`BACK_TO_MERCHANT_CLICKED`})}),` — Deprecated; may still appear in older flows.`]}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`step`})}),` (optional) — Flow step when exit occurred.`]}),`\n`]}),`\n`]}),`\n`]}),_jsxs(_components.p,{children:[_jsx(_components.code,{children:`onExit`}),` can run whether or not `,_jsx(_components.code,{children:`onSuccess`}),` ran. Only `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`onSuccess`})}),` indicates a completed successful Connect flow.`]})]}),`\n`,_jsx(Heading,{level:`3`,id:`onevent`,children:`onEvent`}),`\n`,_jsxs(_components.p,{children:[`Fired for mid-flow and auxiliary transport events. The first argument is `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`type`})}),` (`,_jsx(_components.code,{children:`BenjiConnectEventType`}),`).`]}),`\n`,_jsxs(Expandable,{title:`onEvent`,defaultOpen:`true`,children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`Arguments`})}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`type`})}),` — Values you may see include:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`AUTH_SUCCESS`})}),` — Mid-flow authentication success. Delivered to `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`onEvent`})}),` only (not `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`onSuccess`})}),`). Use for progress or analytics; metadata can include action, user, and token-related fields.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`EVENT`})}),` — Generic events with additional fields in `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`metadata`})}),`.`]}),`\n`,_jsx(_components.li,{children:`Other values may be forwarded for forward compatibility.`}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`metadata`})}),` — Varies by `,_jsx(_components.code,{children:`type`}),`; always includes `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`context`})}),`. Additional keys are merged from the payload when present.`]}),`\n`]}),`\n`]}),_jsx(_components.p,{children:_jsx(_components.strong,{children:`Routing (important):`})}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`FLOW_SUCCESS`})}),` invokes `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`onSuccess`})}),` with the exchange token — not `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`onEvent`})}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`FLOW_EXIT`})}),` invokes `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`onExit`})}),` — not `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`onEvent`})}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`ERROR`})}),` invokes `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`onError`})}),`.`]}),`\n`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Practical distinction:`}),` Implement `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`onSuccess`})}),` for “flow completed + exchange token.” Use `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`onEvent`})}),` when you need mid-flow `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`AUTH_SUCCESS`})}),` or generic `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`EVENT`})}),` data before completion.`]})]}),`\n`,_jsx(Heading,{level:`3`,id:`onerror`,children:`onError`}),`\n`,_jsxs(_components.p,{children:[`Fired when an error occurs in the Connect flow (`,_jsx(_components.code,{children:`ERROR`}),` transport event).`]}),`\n`,_jsxs(Expandable,{title:`onError`,defaultOpen:`true`,children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`Arguments`})}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`error`})}),` — Typically an `,_jsx(_components.code,{children:`Error`}),` instance or platform-specific error information.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`error_id`})}),` — Identifier for support correlation when applicable.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`metadata`})}),` — Additional context; includes `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`context`})}),` where provided.`]}),`\n`]}),_jsx(_components.p,{children:`Documented error names include:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`unexpected_error`})}),` — Unexpected platform error.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`partner_connect_error`})}),` — Failure while connecting the user to the selected loyalty network.`]}),`\n`]}),_jsx(Note,{children:_jsxs(_components.p,{children:[`The `,_jsx(_components.strong,{children:`Benji Connect SDK`}),` may refine `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`onError`})}),` payloads in a future release; treat `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`error`})}),`, `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`error_id`})}),`, and `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`metadata`})}),` as the stable integration surface.`]})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Benji Connect SDK methods and events","description":"Overview of supported methods and events in the Benji Connect SDK","sidebarTitle":"Methods \u0026 Events","href":"/connect/methods"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Methods","slug":"methods","depth":2,"children":[{"title":"open()","slug":"open","depth":3,"children":[]},{"title":"ping()","slug":"ping","depth":3,"children":[]}]},{"title":"Events","slug":"events","depth":2,"children":[{"title":"onSuccess","slug":"onsuccess","depth":3,"children":[]},{"title":"onExit","slug":"onexit","depth":3,"children":[]},{"title":"onEvent","slug":"onevent","depth":3,"children":[]},{"title":"onError","slug":"onerror","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"subdomain":"benji","siteName":"Benji","title":"Benji Connect SDK methods and events - Benji","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-04-16T15:08:34.369Z","originalFileLocation":"connect/methods.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"light\";if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Overview of supported methods and events in the Benji Connect SDK\">\u003cmeta data-mint-head name=\"application-name\" content=\"Benji\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/benji/dbMCKxLdMt2ho1P-/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/benji/dbMCKxLdMt2ho1P-/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/benji/dbMCKxLdMt2ho1P-/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/benji/dbMCKxLdMt2ho1P-/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/benji/dbMCKxLdMt2ho1P-/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/benji/dbMCKxLdMt2ho1P-/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/benji/dbMCKxLdMt2ho1P-/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/benji/dbMCKxLdMt2ho1P-/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/benji/dbMCKxLdMt2ho1P-/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Benji Connect SDK methods and events - Benji\">\u003cmeta data-mint-head property=\"og:description\" content=\"Overview of supported methods and events in the Benji Connect SDK\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Benji\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.withbenji.com/connect/methods\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://benji.mintlify.site/_mintlify/api/og/v2?division=Benji+Connect+SDK\u0026amp;title=Benji+Connect+SDK+methods+and+events\u0026amp;description=Overview+of+supported+methods+and+events+in+the+Benji+Connect+SDK\u0026amp;theme=c6069e65afe5566508648c56\u0026amp;signature=371aaab7ba0443646a941d48b4621cdf5ee91ade31565f6838f75f313513b34e\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Benji Connect SDK methods and events - Benji\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Overview of supported methods and events in the Benji Connect SDK\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://benji.mintlify.site/_mintlify/api/og/v2?division=Benji+Connect+SDK\u0026amp;title=Benji+Connect+SDK+methods+and+events\u0026amp;description=Overview+of+supported+methods+and+events+in+the+Benji+Connect+SDK\u0026amp;theme=c6069e65afe5566508648c56\u0026amp;signature=371aaab7ba0443646a941d48b4621cdf5ee91ade31565f6838f75f313513b34e\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/benji/dbMCKxLdMt2ho1P-/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Benji\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#9900ff\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.withbenji.com/connect/methods\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/connect/methods.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.withbenji.com/#organization\",\"name\":\"Benji\",\"url\":\"https://docs.withbenji.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/benji/E3tFqos-Cc64Y5MH/logo/benji-docs-logo.svg?fit=max\u0026auto=format\u0026n=E3tFqos-Cc64Y5MH\u0026q=85\u0026s=60b7d848ffe4ab0c66efcfcbf573e3be\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.withbenji.com#website\",\"name\":\"Benji\",\"url\":\"https://docs.withbenji.com\",\"publisher\":{\"@id\":\"https://docs.withbenji.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.withbenji.com/connect/methods#webpage\",\"url\":\"https://docs.withbenji.com/connect/methods\",\"name\":\"Benji Connect SDK methods and events\",\"description\":\"Overview of supported methods and events in the Benji Connect SDK\",\"dateModified\":\"2026-04-16T15:08:34.369Z\",\"isPartOf\":{\"@id\":\"https://docs.withbenji.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.withbenji.com/connect/methods#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.withbenji.com/connect/methods#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Benji Connect SDK\",\"item\":\"https://docs.withbenji.com/connect/introduction\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Benji Connect SDK methods and events\",\"item\":\"https://docs.withbenji.com/connect/methods\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.withbenji.com/connect/methods#article\",\"headline\":\"Benji Connect SDK methods and events\",\"name\":\"Benji Connect SDK methods and events\",\"description\":\"Overview of supported methods and events in the Benji Connect SDK\",\"url\":\"https://docs.withbenji.com/connect/methods\",\"mainEntityOfPage\":{\"@id\":\"https://docs.withbenji.com/connect/methods#webpage\"},\"dateModified\":\"2026-04-16T15:08:34.369Z\",\"publisher\":{\"@id\":\"https://docs.withbenji.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.withbenji.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Benji\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Benji\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/connect/methods.md","siteName":"Benji","nav":{"global":null,"tabs":[{"tab":"Platform","pages":[{"title":"Platform","href":"/pilot/overview"}]},{"tab":"Benji Connect","groups":[{"group":"Getting Started","pages":[{"title":"Benji Connect Overview","sidebarTitle":"Overview","href":"/connect/overview"},{"title":"Connect modes","sidebarTitle":"Modes","href":"/connect/modes"},{"title":"Create a token to initialize the Benji Connect SDK","sidebarTitle":"Create Token","api":"POST https://api-staging.withbenji.com/auth/connect","href":"/connect/create_token"}]},{"group":"Benji Hosted Connect","pages":[{"title":"Introduction to Benji Hosted Connect","sidebarTitle":"Introduction","href":"/connect/hosted/introduction"}]},{"group":"Benji Connect SDK","pages":[{"title":"Introduction to the Benji Connect SDK","sidebarTitle":"Introduction","href":"/connect/introduction"},{"title":"Initialize the Benji Connect SDK","description":"Importing and initializing the Benji Connect SDK to start connecting your users to their loyalty platforms.","sidebarTitle":"Initialization","href":"/connect/initialization"},{"title":"Benji Connect SDK methods and events","sidebarTitle":"Methods \u0026 Events","href":"/connect/methods"},{"title":"Exchange the Connect Token","description":"Exchange the short-lived token returned from the Benji Connect SDK to a long-lived access token and refresh token using the Benji Platform API","sidebarTitle":"Exchange Token","api":"POST https://authservice-staging.withbenji.com/access/token/exchange","href":"/connect/exchange_token"}]}]},{"tab":"Benji Integrations","pages":[{"title":"Benji Integrations","href":"/integrations/introduction"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/introduction"}]}]},"basePath":"","title":"Benji Connect SDK methods and events - Benji","buildId":"dpl_41S5Z2jG9QnfDRwN1KZrLdBwj7DM","deploymentId":"dpl_41S5Z2jG9QnfDRwN1KZrLdBwj7DM","dynamics":[],"chunks":[]}