@main12/brevo-adapter
v0.1.1
Published
Brevo (Sendinblue) email adapter for Payload CMS — plug-and-play with env vars or explicit config
Readme
@main12/brevo-adapter
Brevo (Sendinblue) email adapter for Payload CMS. Drop-in replacement — works with env vars or explicit config.
import { brevoAdapter } from '@main12/brevo-adapter'
export default buildConfig({
email: brevoAdapter(),
// ...
})Installation
pnpm add @main12/brevo-adapter axiosEnvironment Variables
BREVO_API_KEY=xkeysib-xxxxxxxxxxxxx
BREVO_SENDER_NAME=My App # default: Main 12
[email protected] # default: [email protected]
BREVO_EMAILS_ACTIVE=false # set false to disable (logs to console instead)Explicit Config
brevoAdapter({
apiKey: process.env.BREVO_API_KEY,
senderName: 'My SaaS',
senderEmail: '[email protected]',
active: process.env.NODE_ENV === 'production',
})Dev Mode
Set BREVO_EMAILS_ACTIVE=false to prevent real sends. Emails are logged to console instead — useful for local development and staging environments.
Usage with @main12/auth-login
import { authLoginPlugin } from '@main12/auth-login'
import { brevoAdapter } from '@main12/brevo-adapter'
export default buildConfig({
email: brevoAdapter(),
plugins: [authLoginPlugin({ projectName: 'My App' })],
})The auth-login plugin uses payload.sendEmail() internally — which routes through Brevo automatically.
License
MIT © Main 12
