VitNode

Resend

How to integrete Resend provider to send emails.

More information about Resend.

Install package

pnpm i vitnode-backend-email-resend --filter backend

.env file

Add the following to your .env file:

EMAIL_RESEND_API_KEY={your_api_key}
EMAIL_RESEND_FROM={your_from_email}

Provide config

Provide emailResend to VitNodeCoreModule:

apps/backend/src/app.module.ts
import { Module } from '@nestjs/common';
import { VitNodeCoreModule } from 'vitnode-backend';
import { emailResend } from 'vitnode-backend-email-resend'; 
 
import { DATABASE_ENVS, schemaDatabase } from './database/config';
import { DatabaseModule } from './database/database.module';
import { PluginsModule } from './plugins/plugins.module';
 
@Module({
  imports: [
    VitNodeCoreModule.register({
      database: {
        config: DATABASE_ENVS,
        schemaDatabase,
      },

      email: emailResend({
        api_key: process.env.EMAIL_RESEND_API_KEY, 
        from: process.env.EMAIL_RESEND_FROM, 

      }),
    }),
    DatabaseModule,
    PluginsModule,
  ],
})
export class AppModule {}

On this page