clerk_auth 0.0.8-beta
clerk_auth: ^0.0.8-beta copied to clipboard
Package that will allow you to authenticate and use Clerk from Dart code.
// ignore_for_file: avoid_print
import 'dart:io';
import 'package:clerk_auth/clerk_auth.dart';
Future<void> main() async {
final auth = Auth(
config: const AuthConfig(
publishableKey: '<YOUR-PUBLISHABLE-KEY>',
),
persistor: await DefaultPersistor.create(
storageDirectory: Directory.current,
),
);
await auth.initialize();
await auth.attemptSignIn(
strategy: Strategy.password,
identifier: '<USER-EMAIL>',
password: '<PASSWORD>',
);
print('Signed in as ${auth.user}');
await auth.signOut();
auth.terminate();
}
copied to clipboard