import { NextRequest, NextResponse } from 'next/server'; import { A as AuthgearConfig } from './types-D6m4Hact.js'; interface AuthgearProxyOptions extends AuthgearConfig { /** * Paths that require authentication. Unauthenticated requests are redirected to login. * Supports exact paths and prefix patterns ending with `*` (e.g. "/dashboard/*"). */ protectedPaths?: string[]; /** * Paths that are always public (never redirected to login). * Takes precedence over protectedPaths. * Defaults to ["/api/auth/*"]. */ publicPaths?: string[]; /** * URL to redirect unauthenticated users. Defaults to "/api/auth/login". */ loginPath?: string; } /** * Create a Next.js 16 proxy function for Authgear authentication. * * Usage in `proxy.ts`: * ```ts * import { createAuthgearProxy } from "@authgear/nextjs/proxy"; * export const proxy = createAuthgearProxy({ ...config, protectedPaths: ["/dashboard/*"] }); * ``` */ declare function createAuthgearProxy(options: AuthgearProxyOptions): (request: NextRequest) => Promise; export { type AuthgearProxyOptions, createAuthgearProxy };