better_auth_flutter 0.0.1 copy "better_auth_flutter: ^0.0.1" to clipboard
better_auth_flutter: ^0.0.1 copied to clipboard

Flutter Client side SDK for Better Auth

better_auth_flutter #

Flutter client-side SDK for Better Auth — simplifies integration with the Better Auth backend. Supports email/password authentication, social login, session management, and secure storage.

Features #

  • Email/password sign up, sign in, and sign out
  • Social login (Google, Facebook, etc.) via ID token
  • Automatic session retrieval and validation
  • Persistent cookie-based sessions with cookie_jar
  • Secure local storage of user and session data with shared_preferences
  • Easy-to-use singleton client: BetterAuth.instance.client

Getting Started #

Installation #

Add to your pubspec.yaml:

dependencies:
  better_auth_flutter: ^0.0.1

Then run:

flutter pub get

Initialization #

Before using any API, initialize the SDK (e.g., in your main.dart):

import 'package:flutter/material.dart';
import 'package:better_auth_flutter/better_auth_flutter.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  BetterAuth.init();
  runApp(MyApp());
}