Official Clerk Dart SDK (Pre-release Alpha)
❗️ Breaking changes should be expected until the first stable release (1.0.0) ❗️
Clerk helps developers build user management. We provide streamlined user experiences for your users to sign up, sign in, and manage their profile from your Dart code.
- Dart >= 3.0.0
To use this package you will need to go to your Clerk Dashboard create an application and copy the public and publishable API keys into your project.
import 'package:clerk_auth/clerk_auth.dart';
Future<void> main() async {
final api = Api(
publishableKey: '<YOUR-PUBLISHABLE-KEY>',
);
final response = await api.createSignIn(identifier: '<USER-EMAIL>');
assert(response.client?.signIn?.status == Status.needsFirstFactor);
final signIn = response.client!.signIn!;
final attemptResponse = await api.attemptSignIn(
signIn,
stage: Stage.first,
strategy: Strategy.password,
password: '<PASSWORD>',
);
final client = attemptResponse.client;
assert(client?.signIn == null);
assert(client?.activeSession?.status == Status.active);
assert(client?.activeSession?.publicUserData.identifier.isNotEmpty == true);
}
This SDK is licensed under the MIT license found in the LICENSE file.