Skip to main content
The plugin manages a SupabaseAuth<R> handle. Reach it from any Manager — an AppHandle, a Window, or the App itself — through the SupabaseAuthExt trait.
Rust callers receive the full Session, including the refresh token. Sanitization happens at the command boundary, so only the webview sees a stripped session.

Session lifecycle

sign_up’s third argument is optional serde_json::Value stored as user_metadata.

OAuth

start_oauth_flow opens the system browser, binds the loopback listener, and resolves when the PKCE exchange completes. See OAuth.

Account

Permissions in capabilities/ gate the webview, not Rust. A command excluded from the capability set is still callable from Rust — the permission model exists to limit what untrusted frontend code can reach.

Passkeys

The two-step surface for app-supplied ceremonies is passkey_registration_options / passkey_registration_verify and passkey_authentication_options / passkey_authentication_verify.

State-change callbacks

AuthCore is deliberately Tauri-free: it emits to registered callbacks, and the plugin registers one that forwards to AppHandle::emit for the webview. You can register your own.
The callback receives an AuthChangePayload { event, session } with the same events the webview sees.

Custom ceremony provider

Use PluginBuilder instead of init() when supplying your own WebAuthn ceremony:
An app-supplied provider wins over the built-in for the target OS. See Passkeys.

Concurrency model

Every session mutation — sign-in, sign-up, sign-out, refresh, restore, OAuth completion — serializes through a single mutex held across the network await. That is what makes a sign-out racing a background refresh always end fully signed out: the refresh re-checks state under the lock and cannot resurrect a terminated session. If you add mutations on top of this handle, keep them inside the same discipline rather than reading state, awaiting, and writing back.