Authentication
Clerk JWT authentication for the Golden Suite API.
Authentication
The Golden Suite API uses Clerk-issued JWTs for authentication. All endpoints marked [AUTH] require a valid token.
Getting a Token
In the frontend, use the useAuth hook from Clerk to obtain a short-lived JWT:
import { useAuth } from "@clerk/nextjs";
const { getToken } = useAuth();
const token = await getToken();
Using the Token
Pass the token in the Authorization header as a Bearer token:
curl -X GET https://backend-production-5c86.up.railway.app/api/sources \
-H "Authorization: Bearer <token>"
Error Responses
| Status | Meaning | When |
|---|---|---|
401 Unauthorized | Missing or invalid token | No Authorization header, expired token, or malformed JWT |
403 Forbidden | Insufficient permissions | Valid token but the user lacks access to the requested resource |