KeyWayProvider includes the complete email OTP flow. Your application opens it with login() or KeyWayLoginButton.

Login lifecycle

1

Send a one-time code

The SDK requests an OTP from the managed KeyWay API. Backend email credentials never enter the browser.
2

Create a KeyWay session

A valid code returns a KeyWay session tied to a stable backend user ID.
3

Recover the account

The user ID maps to the same Lit PKP and CKB address on future logins.
4

Start Fiber

With autoConnect enabled, the SDK recovers the device’s Fiber identity and starts the browser node.

Session state

The SDK stores the KeyWay session in browser localStorage and validates it when the provider mounts. Use ready before reading authentication state.
ValueMeaning
readyStored session validation has completed.
authenticatedA valid KeyWay session exists.
user.idStable backend identity for the email account.
statusCurrent authentication or connection lifecycle state.

Device behavior

Channel state belongs to the browser profile that opened the channel. KeyWay permits one active Fiber device lease per account and fails closed if another device takes the lease.
Clearing site data removes the browser-local Fiber database. Version 0.0.1 does not include encrypted channel database backup or device migration.

Branding

appName changes the name shown in KeyWay’s modal. theme selects the built-in light or dark appearance.
The OTP email sender and template are managed by KeyWay in this preview; appName does not currently change the email itself.