@restackio/integrations-resend
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

Restack Resend Integration

This package provides an integration for Resend's email services within the Restack AI framework.

Installation

To install the Resend integration, use npm or yarn:

npm install @restackio/integrations-resend

Configuration

Before using the Resend integration, make sure to set up your Resend API key. You can do this by setting the RESEND_API_KEY environment variable or by passing the API key directly to the client.

Usage

Initializing the Resend Service

To start the Resend service:

// services.ts
import Restack from "@restackio/ai";
import { resendService } from "@restackio/integrations-resend";

export async function services() {
  const client = new Restack();
  resendService({ client }).catch((err) => {
    console.error("Error starting Resend service:", err);
  });
}

services().catch((err) => {
  console.error("Error running services:", err);
});

Available Functions

This integration provides the main function:

  1. resendSendEmail: Send emails using Resend

Sending Emails

// sendEmailWorkflow.ts
import { log, step } from "@restackio/ai/workflow";
import * as resendFunctions from "@restackio/integrations-resend/functions";
import { resendTaskQueue } from "@restackio/integrations-resend/taskQueue";

export async function sendEmailWorkflow() {
  const result = await step<typeof resendFunctions>({
    taskQueue: resendTaskQueue,
  }).resendSendEmail({
    payload: {
      to: "recipient@example.com",
      subject: "Hello from Resend",
      body: "This is a test email.",
    },
  });
  log.info("result", { result });
}

Readme

Keywords

none

Package Sidebar

Install

npm i @restackio/integrations-resend

Weekly Downloads

1

Version

0.0.3

License

none

Unpacked Size

8.79 kB

Total Files

14

Last publish

Collaborators

  • atapiawastaken
  • osmanrestack
  • aboutphilippe