Server‑side proxy for Resend API calls, forwarding bearer tokens and handling errors.
// Source: https://github.com/appwrite/appwrite | License: BSD-3-Clause | Copyright 2019 Appwrite (https://appwrite.io) and individual contributors
// Provided via justclaw.it.com; keep this notice with the code.
/**
* Server-side relay for the handful of Resend API calls the SMTP quick setup
* needs. `api.resend.com` has no CORS support, so the browser cannot call it
* directly; these helpers forward the caller's bearer token and the response
* body without storing either.
*
* Used by `src/routes/_api/resend/*`.
*/
import { sanitizeCreateApiKeyBody } from './resend'
const RESEND_API_BASE_URL = 'https://api.resend.com'
const UPSTREAM_TIMEOUT_MS = 15_000
const MAX_REQUEST_BODY_BYTES = 8 * 1024
const FORWARDED_QUERY_PARAMS = ['limit', 'after', 'before'] as const
const NO_STORE_HEAD
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key