Skip to main content

supabase_auth 3.0.0-dev.15 copy "supabase_auth: ^3.0.0-dev.15" to clipboard
supabase_auth: ^3.0.0-dev.15 copied to clipboard

A Dart client library for Supabase Auth, to sign users up and in, manage their sessions and tokens, and handle OAuth and multi-factor authentication.

example/main.dart

// ignore_for_file: avoid_print

import 'package:supabase_auth/supabase_auth.dart';

/// Example to use with Supabase Auth https://supabase.com/
Future<void> main() async {
  const authUrl = 'http://localhost:9999';
  const supabaseKey = '';
  final client = AuthClient(
    url: authUrl,
    headers: {
      'Authorization': 'Bearer $supabaseKey',
      'apikey': supabaseKey,
    },
    // The pkce flow needs somewhere to keep its code verifiers. Swap this for
    // a persistent storage when the code exchange can happen after a restart.
    asyncStorage: MemoryAuthAsyncStorage(),
  );

  try {
    final login = await client.signInWithPassword(
      email: 'email',
      password: '12345',
    );
    print('Logged in, user id: ${login.user.id}');
  } on AuthException catch (error) {
    print('Sign in error: ${error.message}');
  }

  await client.signOut();
  print('Logged out!');
}
2
likes
160
points
2.35k
downloads

Documentation

Documentation
API reference

Publisher

verified publishersupabase.io

Weekly Downloads

A Dart client library for Supabase Auth, to sign users up and in, manage their sessions and tokens, and handle OAuth and multi-factor authentication.

Homepage
Repository (GitHub)
View/report issues

Topics

#supabase #authentication #backend #api

License

MIT (license)

Dependencies

clock, collection, crypto, dart_jsonwebtoken, http, logging, meta, supabase_common, web

More

Packages that depend on supabase_auth