Commit 2ed5c1a
committed
refactor(astro): Reuse clerk-client.ts in keyless service
Replace manual createClerkClient calls with the existing clerkClient helper,
matching React Router's pattern of reusing the framework's client factory.
Changes:
- Import clerkClient from '../clerk-client' instead of createClerkClient from @clerk/backend
- Use clerkClient(context) in createAccountlessApplication and completeOnboarding
- Remove manual client configuration (secretKey, publishableKey, apiUrl, userAgent)
- Client now properly inherits all configuration from getSafeEnv(context)
Benefits:
✅ DRY - reuses existing client configuration logic
✅ Consistent - all API calls use same client setup
✅ Maintainable - client config changes apply everywhere
✅ Matches React Router pattern exactly
✅ Inherits telemetry, sdkMetadata, and all other configs automatically1 parent 3bc54de commit 2ed5c1a
1 file changed
Lines changed: 5 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | 2 | | |
4 | 3 | | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 48 | + | |
56 | 49 | | |
57 | 50 | | |
58 | 51 | | |
| |||
61 | 54 | | |
62 | 55 | | |
63 | 56 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
72 | 60 | | |
73 | 61 | | |
74 | 62 | | |
| |||
0 commit comments