Call Clerk Backend API from Client Side
Never place CLERK_SECRET_KEY inside Frontend / Web source. RealComposer injects them when calling https://api.clerk.com/v1/users/{{query.userId}}, so browsers see only a client token.
Clerk publishable keys (pk_) are meant for frontends, while secret keys (sk_) call the Backend API and must stay server-side. Verify session tokens on the server, and authorize from public or private metadata only, because unsafeMetadata can be edited by the user.
Initializes Clerk components in the browser or app.
Reads and manages every user, session, and organization.
Use networkless verification with your instance public key before trusting a user ID.
Only the Backend API can write those fields, so they are safe for authorization.
Users can set unsafeMetadata from the frontend and grant themselves roles.
Derive identity from the verified session token, not client input.
It requires the secret key, which would then be public.
Store CLERK_SECRET_KEY in the vault and expose a pipeline that returns only safe user fields, such as display name and plan, for a verified session.
Yes. It only identifies your Clerk instance to frontend SDKs.
Never place CLERK_SECRET_KEY inside Frontend / Web source. RealComposer injects them when calling https://api.clerk.com/v1/users/{{query.userId}}, so browsers see only a client token.
Instead of Frontend / Web firing serial fetches to PostHog and Clerk, one pipeline hits https://us.posthog.com/api/projects/{{query.projectId}}/feature_flags (and sibling steps) in parallel and returns mapped JSON.
Clerk user profile and Intercom contact record stitched for in-app chat. For "combine intercom users with clerk user metadata", store INTERCOM_ACCESS_TOKEN, CLERK_SECRET_KEY in Secret Vault, call https://api.intercom.io/contacts from a Worker, and let React / Flutter / Mobile hit only https://realcomposer.com/v1/workspace/combine-intercom-with-clerk-users with an rc_live_ client token.
Clerk session and Firebase FCM registration merged at startup. For "stitch firebase with clerk session bootstrap", store FIREBASE_ACCESS_TOKEN, CLERK_SECRET_KEY in Secret Vault, call https://firestore.googleapis.com/v1/projects/{{query.projectId}}/databases/(default)/documents/{{query.collection}}/{{query.docId}} from a Worker, and let React Native hit only https://realcomposer.com/v1/workspace/stitch-firebase-with-clerk-bootstrap with an rc_live_ client token.
A JSON Web Token (JWT) is a compact, URL-safe token containing a JSON payload of claims, such as user ID and expiration, signed by the issuer. Servers verify the signature to trust the claims without a database lookup, enabling stateless authentication.
OpenID Connect (OIDC)OpenID Connect (OIDC) is an identity layer built on OAuth 2.0 that lets applications verify who a user is. Alongside an access token, the identity provider issues a signed ID token, a JWT containing claims such as the user ID, email, and authentication time.
Principle of Least PrivilegeThe principle of least privilege states that every user, service, and credential should have only the minimum permissions required to perform its task. For APIs, this means using restricted keys, narrow OAuth scopes, and client tokens limited to specific endpoints.