mirror of
https://github.com/n8n-io/n8n-nodes-starter.git
synced 2025-10-28 22:12:26 -05:00
Adds a new integration for Resend, an email sending service. Includes: - Resend API credential (`ResendApi.credentials.ts`) for API key authentication. - Resend action node (`nodes/Resend/Resend.node.ts`): - Supports "Send Email" operation with parameters for to, from, subject, html, text, cc, bcc, reply_to, and tags. - Uses Resend API `https://api.resend.com/emails`. - Resend trigger node (`nodes/Resend/ResendTrigger.node.ts`): - Handles Resend webhooks for various event types (email.sent, email.delivered, etc.). - Implements webhook signature verification using Svix and a user-provided signing secret. - Allows you to select which events to listen for. - Official Resend SVG icon (`nodes/Resend/Resend.svg`). - Adds `svix` as a dependency for webhook verification.
27 lines
554 B
TypeScript
27 lines
554 B
TypeScript
import {
|
|
ICredentialType,
|
|
INodeProperties,
|
|
IAuthData,
|
|
} from 'n8n-workflow';
|
|
|
|
export class ResendApi implements ICredentialType {
|
|
name = 'resendApi';
|
|
displayName = 'Resend API';
|
|
documentationUrl = 'https://resend.com/docs/api-reference/introduction';
|
|
properties: INodeProperties[] = [
|
|
{
|
|
displayName: 'API Key',
|
|
name: 'apiKey',
|
|
type: 'string',
|
|
default: '',
|
|
required: true,
|
|
},
|
|
];
|
|
// Use IAuthData for authentication
|
|
authenticate: IAuthData = {
|
|
type: 'apiToken',
|
|
properties: {
|
|
token: '={{$credentials.apiKey}}'
|
|
}
|
|
};
|
|
}
|