veta_auth_kit 0.1.0
veta_auth_kit: ^0.1.0 copied to clipboard
Veta auth kit for Flutter — mirrors @vetaui/auth-kit strategies + capability-driven screens.
veta_auth_kit #
Flutter mirror of @vetaui/auth-kit: AuthStrategy + AuthCapabilities + mock /
Firebase / Supabase adapters and capability-driven screens.
Setup #
import 'package:veta_foundations/veta_foundations.dart';
import 'package:veta_auth_kit/veta_auth_kit.dart';
void main() {
configureVeta({'auth': mockAuthStrategy()});
runApp(const MyApp());
}
Use VetaSignInPage (or pass strategy: explicitly). Call getAuthCapabilities() before optional API methods — unsupported calls throw AuthKitNotSupportedException.
Strategies #
| Strategy | When to use |
|---|---|
mockAuthStrategy() |
Docs, demos, tests — full capability surface in memory. |
firebaseAuthStrategy(FirebaseAuth.instance, …) |
Production apps on Firebase Auth. Initialize Firebase first. |
supabaseAuthStrategy(Supabase.instance.client) |
Production apps on Supabase — initialize Supabase.initialize first. |
Custom backends: extend AuthStrategy, override supported methods; leave the rest as defaults (they throw).
Fixtures #
shared/fixtures/auth/sessions.json documents sample session rows aligned with the mock strategy seed data.
Dependencies #
This package lists firebase_auth and supabase_flutter so the Firebase and Supabase strategies type-check. Apps that only use mockAuthStrategy still resolve those packages; exclude unused native setup if you need a slimmer tree (split packages is a future refactor).