@mono.co/connect.js 2.2.0.
Account-linking sequence
Invariants
Browser lifecycle
keyis required when constructingConnect.onSuccessis required when constructingConnect.- Account linking should set
scope: "auth"and providedata.customer. - Call
setup()beforeopen()for new account linking and payment flows. - Call
reauthorise(accountId)beforeopen()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
onSuccessresult contains a short-lived code; the backend exchanges it for an account ID. - Event payloads vary by event and should be read defensively.