-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.ts
More file actions
82 lines (74 loc) · 2.56 KB
/
index.ts
File metadata and controls
82 lines (74 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/**
* @workos/authkit-session
*
* Framework-agnostic authentication library for WorkOS.
*
* Provides authentication business logic (JWT verification, token refresh)
* with a pluggable storage adapter pattern for framework integration.
*
* **What frameworks do:**
* - Implement storage adapter (SessionStorage<TRequest, TResponse>)
* - Add middleware for auth validation and refresh
* - Export framework-specific helpers
* - Handle session encryption (or use our fallback)
*
* **What this library does:**
* - All authentication logic (AuthService)
* - JWT verification (JWKS with caching)
* - Token refresh orchestration
* - WorkOS API operations
* - Session encryption fallback (iron-webcrypto, AES-256-CBC)
*/
// ============================================
// Public API
// ============================================
export { AuthService } from './service/AuthService.js';
export { createAuthService } from './service/factory.js';
// ============================================
// Advanced (Internal Layers)
// ============================================
export { AuthKitCore } from './core/AuthKitCore.js';
export { AuthOperations } from './operations/AuthOperations.js';
// ============================================
// Storage Helpers
// ============================================
export { CookieSessionStorage } from './core/session/CookieSessionStorage.js';
// ============================================
// Encryption Fallback
// ============================================
export { default as sessionEncryption } from './core/encryption/ironWebcryptoEncryption.js';
// ============================================
// Configuration
// ============================================
export {
configure,
getConfig,
getConfigurationProvider,
validateConfig,
} from './core/config.js';
export { ConfigurationProvider } from './core/config/ConfigurationProvider.js';
// ============================================
// Client Factory
// ============================================
export { getWorkOS } from './core/client/workos.js';
// ============================================
// Errors
// ============================================
export {
AuthKitError,
SessionEncryptionError,
TokenValidationError,
TokenRefreshError,
} from './core/errors.js';
// ============================================
// Type Exports
// ============================================
export * from './core/session/types.js';
export * from './core/config/types.js';
export type {
User,
Impersonator,
Organization,
WorkOS,
AuthenticationResponse,
} from '@workos-inc/node';