
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Framework guides
Next.js - Remix - Nuxt - Express - RedwoodJS - Hono - Bun - Astro
Node.js library for the Resend API.
npm install resend
# or
yarn add resend
Send email with:
First, you need to get an API key, which is available in the Resend Dashboard.
import { Resend } from 'resend';
const resend = new Resend('re_xxxx...xxxxxx');
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!',
});
[!NOTE]
In order to send from your own domain, you will first need to verify your domain in the Resend Dashboard.
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>',
});
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" />,
});
[!NOTE] If your endpoint is a JS/TS file, render the template (i.e., pass
EmailTemplate({firstName="John", product="MyApp"})
instead of the component).
MIT License
FAQs
Node.js library for the Resend API
The npm package resend receives a total of 518,149 weekly downloads. As such, resend popularity was classified as popular.
We found that resend demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
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.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.