clerk_auth 0.0.10-beta copy "clerk_auth: ^0.0.10-beta" to clipboard
clerk_auth: ^0.0.10-beta copied to clipboard

Package that will allow you to authenticate and use Clerk from Dart code.

example/main.dart

// ignore_for_file: avoid_print

import 'dart:io';

import 'package:clerk_auth/clerk_auth.dart';

Future<void> main() async {
  final auth = Auth(
    config: AuthConfig(
      publishableKey: '<YOUR-PUBLISHABLE-KEY>',
      persistor: DefaultPersistor(getCacheDirectory: () => Directory.current),

      // To enable running of the example in e.g. Flutter environments where
      // [Directory.current] causes problems, implement a bespoke [Persistor]
      // for your environment, or replace the above line with...
      //
      // persistor: Persistor.none,
    ),
  );

  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();
}
6
likes
0
points
2.05k
downloads

Publisher

verified publisherclerk.com

Weekly Downloads

Package that will allow you to authenticate and use Clerk from Dart code.

Homepage
Repository (GitHub)
View/report issues

Topics

#authentication

License

unknown (license)

Dependencies

collection, http, json_annotation, logging, meta

More

Packages that depend on clerk_auth