Skip to content
pubscout

flutter_better_auth

0.6.6, released 3 weeks ago by miladev.site

Dart and Flutter client for the Better Auth platform.

$ flutter pub add flutter_better_auth
Source repository

What it does

Enables secure sign-in, sign-up, social OAuth, and session management in Flutter applications using the Better Auth platform. Supports first-party plugins such as 2FA, passkeys, organizations, and magic links.

AI-written summary of version 0.6.6, based on the package's README and metadata. Report an inaccuracy

Use it when

  • Your backend is built with Better Auth and you need a native Flutter client.
  • You require secure encrypted session storage and reactive auth state changes in your app.

Skip it when

  • You use a completely different backend authentication provider like Firebase or Supabase.

Strengths

  • Full-featured integration covering sign-in, sign-up, session management, and first-party plugins.
  • Built-in reactive auth state with automatic session refresh on app resume and network reconnect.
  • Encrypted session storage by default using Keychain and Keystore.

Weaknesses

  • Requires a matching Better Auth server setup and configuration.
  • Native social sign-in requires specific platform-level intent filter configuration.

Setup

Kind
Flutter widgets
Effort
Medium
Code generation
Yes (build_runner)
Direct dependencies
13

Requires initializing with a base URL and deep-link scheme, and registering the callback activity in Android's AndroidManifest.xml for native social login.

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await FlutterBetterAuth.initialize(
    url: 'https://your-server.com/api/auth',
    scheme: 'myapp',
  );
  runApp(const MyApp());
}

Alternatives

Packages that do the same job and could replace flutter_better_auth.

  • firebase_auth

    Choose this if your backend is Firebase instead of a self-hosted Better Auth server.

Works with

Packages commonly used together with flutter_better_auth: ones it builds on, ones built on it, and its own family.