New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@vcapretz/resend

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vcapretz/resend

Node.js library for the Resend API

  • 0.0.1
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Resend Node.js SDK

Node.js library for the Resend API.

Install

npm install resend
# or
yarn add resend

Examples

Send email with:

  • Node.js
  • Next.js (App Router)
  • Next.js (Pages Router)
  • Express

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',
  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',
  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(props) {
  const { firstName, product } = props;

  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',
  subject: 'hello world',
  react: <EmailTemplate firstName="John" product="MyApp" />,
});

License

MIT License

FAQs

Package last updated on 17 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc