Getting started

Installation

Pick the packages your app needs and set up the platforms.

Pick your packages

A Flutter app needs authyra_flutter, which re-exports the core. Add the others for what you use:

flutter pub add authyra_flutter
flutter pub add authyra_dio      # if your app uses Dio
flutter pub add authyra_google   # native Google Sign-In
flutter pub add authyra_apple    # native Sign in with Apple

A pure Dart program (a CLI, a server calling another API) uses the core alone:

dart pub add authyra

Requirements

PackageDartFlutter
authyra3.5none
authyra_dio3.8none
authyra_flutter3.83.24
authyra_apple3.83.24
authyra_google3.83.27

Platform setup

Only what you use needs setting up.

Secure storage

SecureAuthStorage is built on flutter_secure_storage. Follow its platform notes, in particular:

  • macOS: add the Keychain Sharing capability (keychain-access-groups entitlement), or reads and writes fail.
  • Linux: install libsecret-1-dev to build, and a secret service (GNOME Keyring, KWallet) at runtime.
  • Web: storage relies on WebCrypto and is not a secure enclave. Treat tokens on the web as readable by any script running on your origin.

Browser-based sign-in

OAuth2Provider and BackendOAuthProvider open a secure browser session with flutter_web_auth_2. Your redirect URI uses a custom scheme such as com.example.app:/oauth-callback:

  • iOS and macOS: nothing to configure, ASWebAuthenticationSession captures the scheme.
  • Android: declare the callback activity for your scheme in AndroidManifest.xml, as described in the flutter_web_auth_2 README.
  • Web: serve the small callback page from the same origin.

No deep-link routing is needed in your app: the browser session returns the redirect URL directly to the sign-in call.

Native providers

Copyright © 2026