Skip to main content
Initialize Connect.js in ngOnInit, keep the instance on the component, and close it during teardown.

Account-linking component

The template opens the mounted widget only after onLoad marks it ready.
Load PUBLIC_KEY from Angular’s browser-safe environment configuration. Do not add the Mono secret key to that configuration.

Reauthorization

For an existing linked account, replace setup() with reauthorise(accountId).
The argument is the Mono account ID string. It is not an auth code or reauth token.

Angular-specific checks

  • Initialize after Angular creates the component in the browser.
  • Keep one SDK instance for the component lifetime.
  • Tear down the mounted widget in ngOnDestroy.
  • Route onSuccess data to a backend endpoint.
  • Keep MONO_SECRET_KEY in the server environment only.
See Basic account linking for the full lifecycle and Troubleshooting for common failures.