clerk_auth
0.0.18-beta, released 4 months ago by clerk.com
Dart SDK for Clerk authentication and user management.
What it does
Provides sign‑up, sign‑in, session handling and user profile management through Clerk's API. Includes session‑token polling and support for passkeys and organization data. Works across Android, iOS, macOS, Windows and Linux.
AI-written summary of version 0.0.18-beta, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need Clerk as your authentication backend
- You want a single package handling sign‑in, sign‑up and session token streams
- You require cross‑platform support without native SDKs
Skip it when
- You need a stable, production‑ready SDK (still beta)
- You prefer official provider SDKs like Firebase or Google Sign‑In
- Your app only needs simple local biometrics
Strengths
- Community‑maintained with frequent updates
- Supports passkeys, session token streaming and organization metadata
- Works on all major desktop and mobile platforms
Weaknesses
- Beta status – breaking changes expected
- Limited to Clerk backend only
- Documentation still emerging
Setup
- Kind
- Pure Dart
- Effort
- Medium
- Code generation
- Yes (build_runner)
- Direct dependencies
- 6
Add publishable key in AuthConfig, choose a Persistor (e.g., DefaultPersistor) and ensure a cache directory is provided for the platform.
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: DefaultPersistor(getCacheDirectory: () => 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();
}Alternatives
Packages that do the same job and could replace clerk_auth.
- firebase_auth
Official, stable Firebase authentication with broad community support
99Compare - google_sign_in
Google‑only sign‑in with official SDKs
84Compare - sign_in_with_apple
Apple‑only sign‑in with native support
86Compare
Works with
Packages commonly used together with clerk_auth: ones it builds on, ones built on it, and its own family.
- json_annotationclerk_auth depends on itProvides annotations for json_serializable to generate JSON (de)serialization code.
- loggingclerk_auth depends on itProvides configurable logging with levels and stream listeners for Dart apps.
- retryclerk_auth depends on itProvides automatic retry with exponential back‑off for async functions.
- clerk_flutterBuilt on clerk_authCommunity-maintained Clerk SDK for user authentication and management in Flutter.