# YourMail — Transactional Email API Base URL: https://api.yourmail.dev All endpoints are authed by a Bearer API key. ## Auth - Header: Authorization: Bearer YOUR_API_KEY - Read the key from an environment variable (e.g. YOURMAIL_API_KEY). Never hardcode it. - The key is a server-side secret: call the API only from server code (API route, server action, backend job) — never from a browser/client component, and never behind a client-exposed env prefix (NEXT_PUBLIC_, VITE_, REACT_APP_, EXPO_PUBLIC_, PUBLIC_), which would ship the key to every visitor. - Key format: yourmail_…. One kind of key — name them however you like. - Keys carry a scope: `full` reaches every endpoint; `send` may call only POST /v1/emails and POST /v1/emails/batch (anything else returns 403). ## SDK - Install: npm i yourmail - Construct: new YourMail(process.env.YOURMAIL_API_KEY) - Against any deployment other than the default above, pass the base URL you were given: new YourMail(key, { baseUrl: "https://.convex.site" }). A key is scoped to the deployment that issued it, so sending it to the wrong host returns 401 "Invalid API key". - The SDK is a zero-dependency TypeScript client for the endpoints below. - react-email: pass `react: