resend
TypeScript icon, indicating that this package has built-in type declarations

4.5.1 • Public • Published

Resend Node.js SDK

Node.js library for the Resend API.

Install

npm install resend
# or
yarn add resend

Examples

Send email with:

Setup

First, you need to get an API key, which is available in the Resend Dashboard.

import { Resend } from 'resend';
const resend = new Resend('re_123456789');

Usage

Send your first email:

await resend.emails.send({
  from: 'you@example.com',
  to: 'user@gmail.com',
  replyTo: 'you@example.com',
  subject: 'hello world',
  text: 'it works!',
});

Send email using HTML

Send an email custom HTML content:

await resend.emails.send({
  from: 'you@example.com',
  to: 'user@gmail.com',
  replyTo: 'you@example.com',
  subject: 'hello world',
  html: '<strong>it works!</strong>',
});

Send email using React

Start by creating your email template as a React component.

import React from 'react';

export default function EmailTemplate({ firstName, product }) {
  return (
    <div>
      <h1>Welcome, {firstName}!</h1>
      <p>Thanks for trying {product}. We’re thrilled to have you on board.</p>
    </div>
  );
}

Then import the template component and pass it to the react property.

import EmailTemplate from '../components/EmailTemplate';

await resend.emails.send({
  from: 'you@example.com',
  to: 'user@gmail.com',
  replyTo: 'you@example.com',
  subject: 'hello world',
  react: <EmailTemplate firstName="John" product="MyApp" />,
});

License

MIT License

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
4.5.1100,737latest
4.5.1-canary.09canary

Version History

VersionDownloads (Last 7 Days)Published
4.5.1100,737
4.5.1-canary.09
4.5.016,421
4.5.0-canary.06
4.4.126,757
4.4.1-canary.02
4.4.07,415
4.4.0-canary.03
4.3.011,482
4.3.0-canary-02
4.2.028,694
4.2.0-canary.049
4.1.235,707
4.1.2-canary.08
4.1.16,998
4.1.1-canary.01
4.1.0-alpha.00
4.0.125,931
4.0.1-alpha.02,344
4.0.012,566
4.0.0-canary.01
3.6.0-canary.40
3.6.0-canary.30
3.6.0-canary.21
3.6.0-canary.10
3.6.0-canary.01
3.5.032,115
3.4.03,987
3.3.01,152
3.3.0-canary.01
3.2.011,932
3.2.0-canary.11
3.2.0-canary.01
3.1.02,689
3.0.0684
3.0.0-canary.01
2.1.022,660
2.1.0-canary.21
2.1.0-canary.1235
2.1.0-canary.02
2.0.1-canary.03
2.0.07,226
2.0.0-canary.22
2.0.0-canary.11
2.0.0-canary.019
1.1.010,464
1.1.0-canary.01
1.0.1-canary.21
1.0.1-canary.11
1.0.1-canary.01
1.0.01,724
0.18.0-canary.11
0.18.0-canary.01
0.17.22,251
0.17.139
0.17.01
0.16.0806
0.15.3274
0.15.21
0.15.139
0.15.01
0.14.167
0.14.054
0.13.11
0.13.02
0.12.221
0.12.10
0.12.02
0.11.1688
0.11.03
0.10.0107
0.9.143
0.9.01
0.8.02
0.1.27
0.1.11

Package Sidebar

Install

npm i resend

Weekly Downloads

374,671

Version

4.5.1

License

MIT

Unpacked Size

86.8 kB

Total Files

7

Last publish

Collaborators

  • bukinoshita
  • zenorocha
  • jopcmelo
  • cisneiros
  • carolina-josephik