import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.events.create({
name: 'user.created',
schema: {
type: 'object',
properties: {
plan: { type: 'string' },
},
},
});
{
"object": "event",
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
Create a new event definition.
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.events.create({
name: 'user.created',
schema: {
type: 'object',
properties: {
plan: { type: 'string' },
},
},
});
{
"object": "event",
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
npm install resend@6.10.0-canary.0
import { Resend } from 'resend';
const resend = new Resend('re_xxxxxxxxx');
const { data, error } = await resend.events.create({
name: 'user.created',
schema: {
type: 'object',
properties: {
plan: { type: 'string' },
},
},
});
{
"object": "event",
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
Was this page helpful?