/** * Cloudflare Turnstile server-side verification. * * Pass the token from the client widget + your secret key. This module * never reads process.env — the consuming app supplies config. * * Docs: https://developers.cloudflare.com/turnstile/get-started/server-side-validation/ * Adapted from the proven @adamarant/cms implementation. */ export interface TurnstileVerifyOptions { /** The token returned by the Turnstile widget on the client. */ token: string; /** Your Turnstile secret key. */ secretKey: string; /** Optional end-user IP (recommended). */ remoteIp?: string; /** Optional idempotency key to allow safe retries of the same token. */ idempotencyKey?: string; /** Override the siteverify endpoint (useful for tests). */ endpoint?: string; } export interface TurnstileVerifyResult { success: boolean; /** Raw error codes from Cloudflare, if any. */ errorCodes?: string[]; /** ISO timestamp of the challenge, if provided. */ challengeTs?: string; /** Hostname the challenge was solved on, if provided. */ hostname?: string; } /** * Verify a Turnstile token against Cloudflare's siteverify endpoint. * Returns `{ success: false }` (never throws) on network or parse errors, * with `errorCodes` populated so the caller can log. */ export declare function verifyTurnstileToken(options: TurnstileVerifyOptions): Promise; //# sourceMappingURL=turnstile.d.ts.map