veta_auth_kit
Flutter mirror of @vetaui/auth-kit: AuthStrategy + AuthCapabilities,
auth organisms, and mobile-first capability-driven screens.
Atomic Design layering:
VetaSignInFormis an organism: inputs, submit, secondary providers, loading, errors, and callbacks.VetaSignInPageis the flow-kit screen: it assembles owned screen layout +VetaSignInForm+AuthStrategy.- Flow kits may compose molecules, organisms, and reusable templates, but a
public template is not required. Promote a shell to
templateonly when it is reusable outside that specific flow. - Provider packages such as
veta_auth_kit_firebaseandveta_auth_kit_supabaseimplement the strategy adapter.
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 for generated app screens, or VetaSignInForm only when a
custom layout already owns the screen shell. 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
Backend SDKs live in sibling adapter packages. Generated Firebase apps should
depend on both veta_auth_kit and veta_auth_kit_firebase; the default login
surface is username/email + password unless the product spec explicitly enables
another provider.
Libraries
- veta_auth_kit
- Veta auth kit for Flutter — strategies + capability-driven screens.