authyra_flutter library
authyra_flutter — Flutter layer for Authyra.
Re-exports the entire authyra core and adds:
- OAuth2 providers (Google, GitHub, Apple, generic OAuth2, proxy)
- SecureAuthStorage backed by
flutter_secure_storage - OAuth2CallbackHandler deep-link router
- AuthyraFlutterLogging for Flutter-specific log configuration
Flutter apps need only one import:
import 'package:authyra_flutter/authyra_flutter.dart';
Classes
- AccountManager
- High-level multi-account management API.
- AppleOAuthConfig
- Configuration for Sign in with Apple.
- AppleProvider
- Prebuilt AuthProvider for Sign in with Apple.
- AuthConfig
- Configuration for an AuthyraClient instance.
- AuthProvider
- Abstract interface for all Authyra authentication providers.
- AuthSession
- Represents an authenticated session containing tokens and user identity.
- AuthSignInResult
- The full result of a successful AuthProvider.signIn call.
- AuthState
- The high-level authentication state of the current user.
- AuthStorage
- Pluggable storage interface for Authyra session persistence.
- AuthTokenResult
- Token data returned by a successful AuthProvider.refreshToken call.
- AuthUser
- Represents an authenticated user within the Authyra framework.
- AuthyraClient
- Stateless authentication orchestrator — the core of the Authyra framework.
- AuthyraErrorHandler
- Utility class to handle and categorize errors
- AuthyraFlutterLogging
- Flutter-specific logging configuration for Authyra.
- AuthyraInstance
- Singleton wrapper around AuthyraClient for Flutter applications.
- AuthyraLogger
- Authyra logging utility
- CredentialsProvider
- Authentication provider for email + password (or any custom credentials).
- ErrorRecoveryStrategy
- Defines how to recover from specific errors
- GitHubOAuth2Provider
- Prebuilt OAuth2Provider for GitHub OAuth Apps.
- GoogleProvider
- Prebuilt OAuth2Provider for Google Sign-In.
- InMemoryStorage
- An in-memory AuthStorage implementation for tests and server-side use.
- LoggerConfig
- Logger configuration
- OAuth2CallbackHandler
- Global deep-link router for OAuth2Provider instances.
- OAuth2Config
- Configuration for an OAuth2Provider instance.
- OAuth2Provider
- Generic OAuth 2.0 Authorization Code provider with optional PKCE.
- ProxyOAuthConfig
- Configuration for a backend-driven ("proxy") OAuth provider.
- ProxyOAuthProvider
- Authentication provider that delegates the entire OAuth flow to your backend.
- SecureAuthStorage
-
An AuthStorage implementation backed by
flutter_secure_storage.
Enums
- AuthProviderType
- The authentication strategy implemented by a provider.
- AuthStateType
- Discriminant enum for AuthState.
- LogLevel
- Log levels for Authyra
Mixins
- AuthyraLogging
- Mixin for easy logging in classes
Typedefs
-
AuthorizeCallback
= Future<
AuthUser?> Function(Map<String, dynamic> ? credentials) - Callback that validates credentials and returns the authenticated user.
-
AuthorizeWithTokensCallback
= Future<
AuthSignInResult?> Function(Map<String, dynamic> ? credentials) - Extended callback that returns the full AuthSignInResult with tokens.
- Authyra = AuthyraInstance
- Short alias for AuthyraInstance.
- ProxyOauthConfig = ProxyOAuthConfig
- Deprecated alias for ProxyOAuthConfig.
Exceptions / Errors
- AccountNotFoundException
- Thrown when account is not found
- AuthenticationCancelledException
- Thrown when authentication is cancelled by the user
- AuthenticationFailedException
- Thrown when authentication fails
- AuthException
- Base exception class for all Authyra errors
- BackendSyncException
- Thrown when backend sync operations fail
- CorruptedDataException
- Thrown when stored data is corrupted
- DuplicateAccountException
- Thrown when trying to add a duplicate account
- InvalidConfigurationException
- Thrown when configuration is invalid
- InvalidCredentialsException
- Thrown when credentials are invalid
- InvalidEmailException
- Thrown when email format is invalid
- InvalidPasswordException
- Thrown when password doesn't meet requirements
- InvalidProviderConfigException
- Thrown when provider configuration is invalid
- InvalidTokenException
- Thrown when token is invalid or malformed
- MissingAuthParametersException
- Thrown when required authentication parameters are missing
- NetworkException
- Thrown when network operations fail
- NoInternetException
- Thrown when there's no internet connection
- NotInitializedException
- Thrown when Authyra is used before initialization
- PlatformException
- Thrown when platform-specific operation fails
- ProviderAlreadyRegisteredException
- Thrown when a provider is already registered
- ProviderNotFoundException
- Thrown when a requested provider is not registered
- SessionNotFoundException
- Thrown when session is not found
- SessionOperationException
- Thrown when session operations fail
- StorageException
- Thrown when storage operations fail
- StorageNotInitializedException
- Thrown when storage is not initialized
- TimeoutException
- Thrown when request times out
- TokenExpiredException
- Thrown when access token has expired
- TokenRefreshFailedException
- Thrown when token refresh fails
- UnsupportedPlatformException
- Thrown when feature is not supported on current platform
- ValidationException
- Thrown when input validation fails