Something went wrong. Try again.
The logic for serving and storing associations between users and apps
Something went wrong. Try again.
12345678910111213141516171819202122export type RateLimiter = { limit(options: { key: string }): Promise<{ success: boolean }>;};
export async function allowRequest( limiter: RateLimiter | undefined, key: string,): Promise<boolean> { if (!limiter) return true; try { const { success } = await limiter.limit({ key }); return success; } catch { // Fail open if the binding misbehaves in local/dev. return true; }}
export function clientIp(request: Request): string { return request.headers.get("CF-Connecting-IP") ?? "unknown";}