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

A dart client library for the GoTrue API.

example/main.dart

import 'package:gotrue/gotrue.dart';

Future<bool> main(List<String> arguments) async {
  const gotrueUrl = 'http://localhost:9999';
  const annonToken = '';
  final client = GoTrueClient(
    url: gotrueUrl,
    headers: {
      'Authorization': 'Bearer $annonToken',
      'apikey': annonToken,
    },
  );

  final login = await client.signIn(
    email: 'email',
    password: '12345',
  );

  if (login.error == null) {
    print('Logged in, uid: ${login.data!.user!.id}');
  } else {
    print('Error!');
  }

  await client.signOut();
  print('Logged out!');
  return true;
}