├── .gitignore ├── renovate.json ├── package.json ├── index.ts ├── README.md └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "config:base" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "resend-node-example", 3 | "private": true, 4 | "scripts": { 5 | "dev": "tsx index.ts" 6 | }, 7 | "dependencies": { 8 | "resend": "6.4.0" 9 | }, 10 | "devDependencies": { 11 | "@types/node": "^24.0.0", 12 | "tsx": "4.20.6", 13 | "typescript": "^5.1.3" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /index.ts: -------------------------------------------------------------------------------- 1 | import { Resend } from 'resend'; 2 | const resend = new Resend('re_123456789'); 3 | 4 | (async function() { 5 | try { 6 | const data = await resend.emails.send({ 7 | from: 'Acme ', 8 | to: ['delivered@resend.dev'], 9 | subject: 'Hello World', 10 | html: 'It works!' 11 | }); 12 | 13 | console.log(data); 14 | } catch (error) { 15 | console.error(error); 16 | } 17 | })(); 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Resend with Node.js 2 | 3 | This example shows how to use Resend with [Node.js](https://nodejs.org). 4 | 5 | ## Prerequisites 6 | 7 | To get the most out of this guide, you’ll need to: 8 | 9 | * [Create an API key](https://resend.com/api-keys) 10 | * [Verify your domain](https://resend.com/domains) 11 | 12 | ## Instructions 13 | 14 | 1. Replace `re_123456789` on `index.ts` with your API key. 15 | 16 | 2. Install dependencies: 17 | 18 | ```sh 19 | npm install 20 | ``` 21 | 22 | 3. Execute the following command: 23 | 24 | ```sh 25 | npm run dev 26 | ``` 27 | 28 | ## License 29 | 30 | MIT License 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Plus Five Five, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. --------------------------------------------------------------------------------