First of all, you should request access to the wallet account. It will trigger wallet's window for providing you with permission. Let’s do this:

const account = await wallet.requestAuthentication();

Now, we can check user's status and make an appropriate action:

if (await ylide.auth.isRegistered(account)) {
    await ylide.auth.login(account);
} else {
    await ylide.auth.register(account);

Key is ready and available for usage.

Last updated