/** Request header the proxy uses to hand the nonce to server components. */ export const CSP_NONCE_HEADER = 'x-nonce' /** * A fresh per-request nonce (base64 of a random UUID, 128 bits of randomness). * Works in the Edge and Node runtimes (Web Crypto + btoa are globals in both). */ export function createCspNonce(): string { return btoa(crypto.randomUUID()) }