Resend
Resend integration for Better Auth.
Installation
Simple Resend configuration.
Example
Simple welcome email on user creation.
lib/auth.ts
Check the Email section to see multiple uses.
Resend integration for Better Auth.
Simple Resend configuration.
pnpm dlx shadcn@latest add @auth-cn/resendSimple welcome email on user creation.
import { betterAuth } from "better-auth";
// Your email template...
import { WelcomeEmail } from "@/emails/vercel-welcome";
// Checked https://auth.uprizing.me/docs/3rd-party/resend
import { sendEmail } from "@/lib/resend";
export const auth = betterAuth({
// Your auth configuration...
databaseHooks: {
user: {
create: {
after: async (user) => {
sendEmail({
from: "Acme <onboarding@resend.dev>",
to: user.email,
subject: "Welcome to Our Service!",
// Provide user name and email.
react: WelcomeEmail({ name: user.name, email: user.email }),
});
},
},
},
},
});
Check the Email section to see multiple uses.