UNPKG

@clerk/nextjs

Version:

Clerk SDK for NextJS

21 lines 1.33 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; export declare const getAuthDataFromRequestSync: (req: RequestLike, { treatPendingAsSignedOut, ...opts }?: GetAuthDataFromRequestOptions) => SignedInAuthObject | SignedOutAuthObject; /** * Note: We intentionally avoid using interface/function overloads here since these functions * are used internally. The complex type overloads are more valuable at the public API level * (like in auth.protect(), auth()) where users interact directly with the types. * * 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