Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.medera.info/llms.txt

Use this file to discover all available pages before exploring further.

End-user authentication is handled by Clerk. The frontend uses @clerk/clerk-react to sign the user in and obtains a session JWT on demand.
import { useAuth } from '@clerk/clerk-react';
const { getToken } = useAuth();
const jwt = await getToken();
Send the JWT to backend endpoints as Authorization: Bearer <jwt>. The backend validates via clerkAuth middleware and writes a phi_audit_logs entry for every PHI-touching request.

Backend webhooks

The backend receives Clerk lifecycle webhooks at:
POST /api/clerk-webhooks
Validated via Svix HMAC signatures.