createConvexIdentityClient

db · /index·functionthrows When

Constructs a FRESH Convex client for identity-authenticated calls — the CONVEXCORE-16 seam the admin app's editor bridge drives. Deliberately NOT the cached module client used by the server-secret transports: an identity client carries a per-request operator bearer token via setAuth, so sharing one instance across requests could leak a stale identity between operators. Callers construct one per request, authenticate it (e.g. through authenticateConvexClient in the admin app), and discard it.

Signature

@nordcom/commerce-db
function createConvexIdentityClient(): ConvexHttpClient;

Returns

A new, unauthenticated ConvexHttpClient for this deployment.

Throws

Error
When neither CONVEX_URL nor NEXT_PUBLIC_CONVEX_URL is set.

FeatureFlagService ReviewService ShopService FeatureFlagOption FeatureFlagRef ResolvedCartLineTokens ResolvedProductCardTokens ResolvedShopTheme

Sourcedb.ts:93Edit the JSDoc directly
Metadata@nordcom/commerce-db@0.1.0Open in GitHub ↗

On this page