mega.connect()
Open the MOSS wallet UI and prompt the user to authenticate. Resolves with the resulting connection status. If the user dismisses the auth flow, the promise resolves with status: 'cancelled' rather than throwing.
Signature
mega.connect(): Promise<ConnectionStatus>
Parameters
None.
Example
const result = await mega.connect();
if (result.status === 'connected') {
console.log('Connected', result.address);
} else if (result.status === 'cancelled') {
console.log('User cancelled wallet authentication');
}Response
Notes
Trigger from a deliberate user action (button click), not on page load.
For account onboarding copy, prefer "Creating your account" / "Restoring account" — see Best Practices.
After connect, subscribe to
events.onStatusChangeso your UI tracks disconnects that happen outside your app.
Last updated