import "server-only"; import { auth } from "@clerk/nextjs/server"; /** * Server-side Clerk auth helpers. * These wrappers ensure consistent access to the current owner's identity. */ /** * Returns the Clerk userId for the currently signed-in owner, or null if * the request is unauthenticated. Use in RSC and server-side code. * * For tRPC procedures, prefer reading ctx.userId directly from the context * (set by createTRPCContext) rather than calling this function. */ export async function getOwnerId(): Promise { const { userId } = await auth(); return userId; }