Configure the browser flow
Create one Connect instance, callsetup() once, and call open() from a user action.
Existing and new customers
Use the Mono customer ID when your backend already has one.Open and close
setup() mounts the hidden widget. open() makes it visible, and close() hides it programmatically.
Complete the link on your backend
The browser should send the short-lived code to an authenticated backend endpoint. The backend exchanges it withMONO_SECRET_KEY, verifies the result, and stores the account ID for the current application user.
Instrument the flow
UseonEvent for product analytics and debugging. Use onSuccess as the browser-side success signal instead of relying on an intermediate event.
Completion checklist
- The widget uses the public key and
authscope, andsetup()runs beforeopen()from a user action. onSuccesssends 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.