CreateVexDraftModeRouteProps
Defined in: packages/next/src/livePreview/createVexDraftModeRoute.ts:25
Props for createVexDraftModeRoute.
Properties
Section titled “Properties”config
Section titled “config”config:
Pick<VexClientConfig,"access"|"collections"|"globals"|"admin">
Defined in: packages/next/src/livePreview/createVexDraftModeRoute.ts:47
The project’s config, client or server: access, collections, globals and
admin.livePreview decide whether the caller can preview anything
(canAccessLivePreview).
getRequestAuth
Section titled “getRequestAuth”getRequestAuth: () =>
Promise<VexApiAuth>
Defined in: packages/next/src/livePreview/createVexDraftModeRoute.ts:41
Resolves the signed-in caller ({ user, organization }) for the current request, e.g. the
app’s getUserOrgForVexApi from ~/auth/server. Takes no ctx: this runs in a Next.js
route, not in Convex, so it is not the (ctx) => … getAuth that vexServerApi takes.
Only called for a request that already carries a session.
Returns
Section titled “Returns”Promise<VexApiAuth>
getToken
Section titled “getToken”getToken: () =>
Promise<string|null|undefined>
Defined in: packages/next/src/livePreview/createVexDraftModeRoute.ts:34
Reads the caller’s session token for the current request. Wire to the host
app’s getToken export (convexBetterAuthNextJs’s output, re-exported
from e.g. ~/auth/server) — the same accessor createVexRevalidateRoute
takes, and the same bar: a present, non-expired token is “authorized”,
exactly as it is for every other session-gated admin action in a VexCMS
project. A falsy return means “no session”.
Returns
Section titled “Returns”Promise<string | null | undefined>