Accessing Accounts
To interact with the user's account in Rabet, you must first connect to it. For connecting to the user account, you must send a connection request to the user. If the user confirms, you will receive the user account public key; otherwise, you will receive an error.
rabet.connect()
.then(result => console.log(`User active public key is: ${result.publicKey}`))
.catch(error => console.error(`Error: ${error}`));

accountChanged event
If you'd like to be notified when the address changes, we have an event you can subscribe to:
rabet.on('accountChanged', () => {
console.log('User changed their active account!');
});
Last updated
Was this helpful?