Click here to activate your account.
You have premium access!
}Thanks for signing up.
Congrats on sending your first email!
", }); return new Response(JSON.stringify(email), { headers: { "Content-Type": "application/json", }, }); } catch (error) { return new Response(JSON.stringify({ error }), { status: 500, headers: { "Content-Type": "application/json", }, }); } } return new Response("Not Found", { status: 404, }); }, }; ``` -------------------------------- ### npm Scripts Source: https://github.com/resend/resend-cloudflare-workers-example/blob/main/_autodocs/README.md Common npm scripts for managing the development environment, linting, and auto-fixing code issues. ```bash npm run dev # Start local development server npm run lint # Check code with linter npm run lint:fix # Auto-fix code issues ``` -------------------------------- ### Env Interface Usage in Fetch Handler Source: https://github.com/resend/resend-cloudflare-workers-example/blob/main/_autodocs/types.md Demonstrates how to access the RESEND_API_KEY from the environment bindings within a Cloudflare Worker's fetch handler. ```typescript async fetch(request, env, context) { const resend = new Resend(env.RESEND_API_KEY); // ... } ``` -------------------------------- ### Worker Handler Source: https://github.com/resend/resend-cloudflare-workers-example/blob/main/_autodocs/api-quick-reference.md The main entry point for the Cloudflare Worker. It receives incoming requests and environment bindings, uses the Resend API key to initialize the Resend client, and sends an email using the provided options. ```APIDOC ## Worker Handler ### Description Handles incoming requests for the Cloudflare Worker. It initializes the Resend client using the `RESEND_API_KEY` from the environment and sends an email. ### Method `fetch(request: Request, env: Env, context: ExecutionContext)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None (handled by the `Request` object) ### Handler Signature ```typescript async fetch(request: Request, env: Env, context: ExecutionContext): Promise