groundmail-better-auth
v0.15.12
Published
Groundmail email helpers for Better Auth (verify, reset, magic link, email OTP, invites)
Downloads
2,544
Maintainers
Readme
groundmail-better-auth
Transactional email for Better Auth — verification, password reset, magic link, email OTP, and organization invites — delivered on Groundmail.
Better Auth does not ship an email provider plugin. You supply callbacks. This package is those callbacks, wired to Groundmail.
Install
npm install groundmail-better-auth groundmail better-authGROUNDMAIL_API_KEY=gm_your_key_hereUsage
import { betterAuth } from 'better-auth'
import { magicLink, emailOTP, organization } from 'better-auth/plugins'
import { createBetterAuthEmail } from 'groundmail-better-auth'
const email = createBetterAuthEmail({
from: '[email protected]',
apiKey: process.env.GROUNDMAIL_API_KEY!,
appUrl: process.env.BETTER_AUTH_URL,
})
export const auth = betterAuth({
emailVerification: {
sendVerificationEmail: email.sendVerificationEmail,
},
emailAndPassword: {
enabled: true,
sendResetPassword: email.sendResetPassword,
},
plugins: [
magicLink({ sendMagicLink: email.sendMagicLink }),
emailOTP({ sendVerificationOTP: email.sendVerificationOTP }),
organization({ sendInvitationEmail: email.sendInvitationEmail }),
],
})Docs
https://docs.groundmail.dev/guides/better-auth
License
MIT
