Clerk Service
Authentication and user management for Fulcrum
Last Updated: January 15, 2026
Purpose
Clerk provides: - User authentication (email, OAuth, SSO) - Session management - User profile storage - Organization/team management (Enterprise)
Key Feature: Enterprise-ready auth with minimal integration effort.
Configuration
| Variable | Required | Default | Description |
|---|---|---|---|
CLERK_SECRET_KEY |
Yes | - | Backend API key |
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY |
Yes | - | Frontend API key |
NEXT_PUBLIC_CLERK_SIGN_IN_URL |
No | /sign-in |
Sign-in page URL |
NEXT_PUBLIC_CLERK_SIGN_UP_URL |
No | /sign-up |
Sign-up page URL |
Dashboard Access
- URL: dashboard.clerk.com
- Application: Fulcrum
- Environment: Development / Production
Integration Points
Dashboard (Next.js)
// proxy.ts
import { clerkMiddleware } from '@clerk/nextjs/server';
export default clerkMiddleware();
// Protected route
import { auth } from '@clerk/nextjs/server';
const { userId } = auth();
Backend (Go)
// Verify JWT from Clerk
func verifyClerkJWT(token string) (*Claims, error) {
// Use Clerk's JWKS endpoint
// https://clerk.com/.well-known/jwks.json
}
User Flow
1. User visits fulcrumlayer.io
2. Clicks "Sign In"
3. Redirected to Clerk-hosted sign-in
4. Authenticates (email, Google, GitHub)
5. Redirected back with session cookie
6. Dashboard reads session, extracts user ID
7. Backend receives user ID in API requests
Webhook Events
| Event | Purpose | Endpoint |
|---|---|---|
user.created |
Create tenant on signup | /api/webhooks/clerk |
user.deleted |
Archive tenant data | /api/webhooks/clerk |
session.created |
Audit login | /api/webhooks/clerk |
Failure Modes
| Failure | Impact | Detection | Recovery |
|---|---|---|---|
| Clerk API down | Login fails | Clerk status page | Wait for Clerk |
| Invalid API key | Auth broken | 401 errors | Rotate keys |
| Webhook failure | Data sync issues | Webhook logs | Retry/replay |
Security
- Keys: Store in environment variables only
- Webhooks: Verify signatures
- Sessions: Clerk manages securely
- 2FA: Enable in Clerk dashboard for admin users
Pricing Tier
- Current: Free tier (10,000 MAU)
- Upgrade trigger: >10,000 monthly active users
Back to Runbooks | Documentation