Main coves client
1/// atproto OAuth client for Flutter.
2///
3/// This library provides OAuth authentication capabilities for AT Protocol
4/// (atproto) applications on Flutter/Dart platforms.
5///
6/// This is a 1:1 port of the TypeScript @atproto/oauth-client package to Dart.
7///
8/// ## Quick Start
9///
10/// ```dart
11/// import 'package:atproto_oauth_flutter/atproto_oauth_flutter.dart';
12///
13/// // 1. Initialize client
14/// final client = FlutterOAuthClient(
15/// clientMetadata: ClientMetadata(
16/// clientId: 'https://example.com/client-metadata.json',
17/// redirectUris: ['myapp://oauth/callback'],
18/// scope: 'atproto transition:generic',
19/// ),
20/// );
21///
22/// // 2. Sign in with handle
23/// final session = await client.signIn('alice.bsky.social');
24/// print('Signed in as: ${session.sub}');
25///
26/// // 3. Use authenticated session
27/// // (Integrate with your atproto API client)
28///
29/// // 4. Later: restore session
30/// final restored = await client.restore(session.sub);
31///
32/// // 5. Sign out
33/// await client.revoke(session.sub);
34/// ```
35///
36/// ## Features
37///
38/// - Full OAuth 2.0 + OIDC support with PKCE
39/// - DPoP (Demonstrating Proof of Possession) for token security
40/// - Automatic token refresh
41/// - Secure session storage (flutter_secure_storage)
42/// - Handle and DID resolution
43/// - PAR (Pushed Authorization Request) support
44/// - Works with any atProto PDS or authorization server
45///
46/// ## Security
47///
48/// - Tokens stored in device secure storage (Keychain/EncryptedSharedPreferences)
49/// - DPoP binds tokens to cryptographic keys
50/// - PKCE prevents authorization code interception
51/// - Automatic session cleanup on errors
52///
53library;
54
55// ============================================================================
56// Main API - Start here!
57// ============================================================================
58
59/// High-level Flutter OAuth client (recommended for most apps)
60export 'src/platform/flutter_oauth_client.dart';
61
62/// Router integration helpers (for go_router, auto_route, etc.)
63export 'src/platform/flutter_oauth_router_helper.dart';
64
65// ============================================================================
66// Core OAuth Client
67// ============================================================================
68
69/// Core OAuth client and types (for advanced use cases)
70export 'src/client/oauth_client.dart';
71
72// ============================================================================
73// Sessions
74// ============================================================================
75
76/// OAuth session types
77export 'src/session/oauth_session.dart';
78
79// ============================================================================
80// Types
81// ============================================================================
82
83/// Core types and options
84export 'src/types.dart';
85
86// ============================================================================
87// Platform Implementations (for custom configurations)
88// ============================================================================
89
90/// Storage implementations (for customization)
91export 'src/platform/flutter_stores.dart';
92
93/// Runtime implementation (cryptographic operations)
94export 'src/platform/flutter_runtime.dart';
95
96/// Key implementation (EC keys with pointycastle)
97export 'src/platform/flutter_key.dart';
98
99// ============================================================================
100// Errors
101// ============================================================================
102
103/// All OAuth error types
104export 'src/errors/errors.dart';