Skip to main content
This page is the compact integration contract for humans and coding agents. It describes the verified behavior of @mono.co/connect.js 2.2.0.

Account-linking sequence

Invariants

Browser lifecycle

  • key is required when constructing Connect.
  • onSuccess is required when constructing Connect.
  • Account linking should set scope: "auth" and provide data.customer.
  • Call setup() before open() for new account linking and payment flows.
  • Call reauthorise(accountId) before open() for reauthorization.

Trust boundaries and outputs

  • reauthorise() accepts an account ID string, not an auth code or reauth token.
  • The public key may be used in browser code.
  • The secret key must remain on the backend.
  • An account-linking onSuccess result contains a short-lived code; the backend exchanges it for an account ID.
  • Event payloads vary by event and should be read defensively.

Constructor contract

Missing required values throw synchronously:

Method contract

Flow outputs

Source boundary

This contract covers the browser SDK implementation. Mono’s official API documentation remains authoritative for server endpoint schemas, payment product behavior, data access, authentication policy, and production requirements.