authenticate() for both new and returning users. Start with the shared client initialization.
Authenticate
- The user verifies an email or OAuth identity in the wallet dialog.
- The service checks for an account in your application’s smart-account namespace.
- WebAuthn creates or uses a passkey in your application’s top-level page.
- The SDK returns the account address and session metadata.
flow: "create-account" or flow: "login" to select the initial presentation, but these values are hints rather than authorization boundaries:
Create an application session
A successfulauthenticate() result proves control of the embedded wallet session. It does not create a session for your own backend. If your application needs one, issue a single-use nonce, include your domain and expiry in a message, then ask the account to sign it:
Sign out
Error handling
Treat structured error codes as control flow.USER_CANCELLED is an expected dismissal; configuration and origin errors require an integration fix. See domain troubleshooting for checks before retrying.