gotrue 2.27.2 copy "gotrue: ^2.27.2" to clipboard
gotrue: ^2.27.2 copied to clipboard

A dart client library for the GoTrue API.

example/main.dart

// ignore_for_file: avoid_print

import 'package:gotrue/gotrue.dart';

/// Example to use with Supabase Auth https://supabase.com/
Future<void> main() async {
  const gotrueUrl = 'http://localhost:9999';
  const supabaseKey = '';
  final client = GoTrueClient(
    url: gotrueUrl,
    headers: {
      'Authorization': 'Bearer $supabaseKey',
      'apikey': supabaseKey,
    },
  );

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

  await client.signOut();
  print('Logged out!');
}
16
likes
150
points
805k
downloads

Documentation

API reference

Publisher

verified publishersupabase.io

Weekly Downloads

A dart client library for the GoTrue API.

Topics

#supabase #authentication #backend #api

License

MIT (license)

Dependencies

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

More

Packages that depend on gotrue