Saved login
Save, restore, and clear a user's email and password so returning users skip the login form.
Saved login
Let returning users sign back in without re-typing their credentials. Methods live on bdk.auth, with one event for the response.
auth.updateCredentials({ email, password })— save credentials after login.auth.clearCredentials()— wipe saved credentials, e.g. on logout.auth.loginViaCredentials()— request saved credentials; they arrive on thesmartLoginCredentialsevent.
loginViaCredentials() doesn't return the credentials — read them from the smartLoginCredentials event.
On the web or runtimes below 1.8, the save/clear commands are skipped — check result.skipped and result.reason. To check support up front, read bdk.getDeviceInfo()?.smartLoginAvailable.
Save credentials after login
Call this right after a user authenticates so they sign in instantly next time.
Only save after you've verified the login is real.
Clear saved credentials
Call this on logout to forget the saved login. Takes no arguments.
Log in with saved credentials
On a returning visit, request the saved credentials. They arrive on the smartLoginCredentials event as { email: string | null; password: string | null }. If either field is null, nothing usable is saved — fall back to your login screen.
Register your smartLoginCredentials listener with bdk.on(...) before you call loginViaCredentials(), or you'll miss the response.