Getting Started

Installation

Add Authyra to your Dart or Flutter project.

Requirements

  • Dart SDK ≥ 3.5.0

Choose your package

Authyra ships as two packages. Pick the one that matches your target:

I'm building…Add this package
A Flutter app with OAuth2 (Google, GitHub, Apple…)authyra_flutter
A Flutter app with email/password onlyauthyra_flutter or authyra
A Dart backend (Shelf, Dart Frog)authyra
A Dart CLI toolauthyra
Unit tests for auth logicauthyra

authyra_flutter re-exports the entire authyra package, so Flutter apps only need one dependency.


Flutter apps — authyra_flutter

pubspec.yaml
dependencies:
  authyra_flutter: ^0.1.0
flutter pub get

This gives you:

WhatDescription
AuthyraClientStateless orchestrator
AuthyraInstance / AuthyraSingleton with reactive streams and sync state
AuthProvider interfaceImplement to add any auth strategy
AuthStorage interfaceImplement any persistence backend
CredentialsProviderEmail / password
OAuth2ProviderAuthorization Code + PKCE (any IdP)
GoogleProviderPrebuilt Google Sign-In
GitHubOAuth2ProviderPrebuilt GitHub OAuth
AppleProviderSign in with Apple
ProxyOAuthProviderBackend-delegated OAuth (client secret stays server-side)
SecureAuthStorageflutter_secure_storage implementation — ready to use
OAuth2CallbackHandlerDeep-link router for OAuth redirects
InMemoryStorageIn-memory store for tests
AccountManagerMulti-account switching and sign-out

Dart backend / CLI — authyra

pubspec.yaml
dependencies:
  authyra: ^0.1.0
dart pub get

This gives you everything above except the OAuth2 providers, SecureAuthStorage, and OAuth2CallbackHandler (those depend on Flutter and platform APIs).

For backend auth flows, implement AuthProvider to talk to your identity server and implement AuthStorage with Redis, an encrypted DB column, or any key-value store.


Verify the install

import 'package:authyra/authyra.dart'; // or authyra_flutter

void main() {
  print(AuthyraInstance.isInitialized); // false — not yet initialized
}

Next steps

Copyright © 2026