UNPKG

@clerk/nextjs

Version:

Clerk SDK for NextJS

21 lines 1.23 kB
import type { AuthObject } from '@clerk/backend'; import { type AuthenticateRequestOptions, type SignedInAuthObject, type SignedOutAuthObject } from '@clerk/backend/internal'; import type { PendingSessionOptions } from '@clerk/types'; import type { LoggerNoCommit } from '../../utils/debugLogger'; import type { RequestLike } from '../types'; export type GetAuthDataFromRequestOptions = { secretKey?: string; logger?: LoggerNoCommit; acceptsToken?: AuthenticateRequestOptions['acceptsToken']; } & PendingSessionOptions; /** * Given a request object, builds an auth object from the request data. Used in server-side environments to get access * to auth data for a given request. */ export declare const getAuthDataFromRequestSync: (req: RequestLike, { treatPendingAsSignedOut, ...opts }?: GetAuthDataFromRequestOptions) => SignedInAuthObject | SignedOutAuthObject; /** * Given a request object, builds an auth object from the request data. Used in server-side environments to get access * to auth data for a given request. */ export declare const getAuthDataFromRequestAsync: (req: RequestLike, opts?: GetAuthDataFromRequestOptions) => Promise<AuthObject>; //# sourceMappingURL=getAuthDataFromRequest.d.ts.map