Skip to main content
Start with the Quickstart for the first working integration. This page adds customer handling, lifecycle callbacks, and safe diagnostics.

Configure the browser flow

Create one Connect instance, call setup() once, and call open() from a user action.
The required account-linking configuration is:

Existing and new customers

Use the Mono customer ID when your backend already has one.
Supply customer details when creating a new customer in the flow.
Confirm current identity requirements in Mono’s official documentation before collecting or sending sensitive identity data.

Open and close

setup() mounts the hidden widget. open() makes it visible, and close() hides it programmatically.
The browser should send the short-lived code to an authenticated backend endpoint. The backend exchanges it with MONO_SECRET_KEY, verifies the result, and stores the account ID for the current application user.
See the Quickstart for the corresponding backend exchange request.

Instrument the flow

Use onEvent for product analytics and debugging. Use onSuccess as the browser-side success signal instead of relying on an intermediate event.
Event payloads vary by event. Read properties defensively and avoid logging credentials, identity values, or other sensitive user input.

Completion checklist

  • The widget uses the public key and auth scope, and setup() runs before open() from a user action.
  • onSuccess sends the auth code to an authenticated backend endpoint.
  • The secret key is present only on the backend.
  • The returned account ID is associated with the correct application user.
  • Event and error logs use an allowlist that excludes sensitive data.