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:
Solana-enabled sign-in
Withexperimental_solana, the first passkey login provisions a persistent Solana identity; later logins reuse it. Restore its state with getSession(), but do not treat the address as deployed or ready to receive. Follow Solana setup.
Solana sends use the passkey retained from successful sign-in. Restoring a session without that key can return SOLANA_SIGN_IN_REQUIRED: ask the user to sign in with their passkey again. There is no caller-selected root or alternate-key fallback. A fresh authentication or wallet switch invalidates unsubmitted work; status tracking remains separate from resubmission.
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.