Reference

API reference

The full API documentation of each package, and the members you use most.

The complete, versioned API documentation is generated from the source on pub.dev:

Authyra at a glance

MemberPurpose
Authyra.initialize(storage:, providers:, policy:, config:)Creates, starts and registers the app-wide instance.
Authyra.instanceThe instance registered by initialize.
Authyra(...) + start()An instance you inject yourself.
state, statesThe current AuthState, and a stream of it.
eventsA stream of AuthEvent.
currentSession, sessionsThe active session, and all of them.
signIn(providerId, params:, activate:)Signs in and stores the session.
switchTo(key)Makes another stored session active.
signOut(key:), signOutAll()Ends one or every session.
accessToken(key:, rejectedToken:)A valid access token, refreshed first if needed.
refresh(key:)Refreshes now.
refreshIfNeeded()Refreshes the active session if due. Called by AuthyraScope on resume.
dispose()Stops background work and waits for pending writes.
Copyright © 2026