resend-ai-sdk
v1.0.0
Published
Resend email tools for the AI SDK
Readme
Resend - AI SDK Tools
A collection of AI SDK tools that give your AI agents the ability to send and manage emails using Resend.
Installation
npm install resend-ai-sdkSetup
Set the following environment variables:
RESEND_API_KEY="your_resend_api_key"
RESEND_EMAIL_DOMAIN="your_verified_domain.com"Get your API key from the Resend Dashboard.
You'll also need to verify your domain to send emails.
Usage
import { generateText, stepCountIs } from "ai";
import { sendEmail, listTemplates, getTemplate } from "resend-ai-sdk";
const { text } = await generateText({
model: 'openai/gpt-5.2',
tools: { sendEmail, listTemplates, getTemplate },
prompt: "Find my welcome template and send it to [email protected] from [email protected]",
stopWhen: stepCountIs(5),
});Available Tools
| Tool | Description |
|------|-------------|
| sendEmail | Send an email with HTML, plain text, or a template |
| sendBatchEmails | Send multiple emails at once (up to 100) |
| getEmail | Retrieve the status and metadata of a sent email |
| listEmails | List recently sent emails |
| listTemplates | List available email templates with pagination |
| getTemplate | Retrieve a template's content, variables, and metadata |
| createContact | Add a new contact to your Resend account |
| listContacts | List contacts in your account |
| removeContact | Remove a contact permanently (requires approval) |
AI SDK Library
Find other AI SDK agents and tools in the AI SDK Library.
Resources
Contributing
Contributions are welcome! Please read our Contributing Guide for more information.
