Brevo
A Brevo component for Bijection.
git clone https://github.com/bijectionhq/brevo.git
cd brevo
git checkout 258ecfc86afb596ee50f16d005a40f41d9053708Bijection repository access is required. Request access.
Description
A Brevo component for Bijection.
Explore the package README for API concepts, configuration, and examples. Check the Bijection source for adaptation-specific setup.
Review the source and its dependencies before adopting this package. Source availability does not establish npm publication or runtime qualification.
Getting started
- Get the source at the revision above and read its package documentation.
- Check the required Bijection SDK version, dependencies, and external service credentials.
- Follow the package setup instructions and the guide to using components.
- Exercise the component in your deployment according to your project’s verification rules.
Open source
Maintained source: bijectionhq/brevo. Based on pierre-H/convex-brevo. License: Apache-2.0. Consult the repository for license terms, notices, and contributor attribution.
From the upstream publisher
A Brevo component for Convex.
Explore the demo ↗Upstream overview
From the upstream package documentation.
The Brevo component provides durable transactional email and SMS delivery through Convex's queueing system. It integrates with Brevo's API endpoints for email and SMS, handles webhook-based status tracking, and provides rate-limited delivery with sandbox mode support. Developers get a fully managed email/SMS pipeline with status queries, cancellation, and retry capabilities built into their Convex backend.
Use cases
From the upstream package documentation.
- Transactional emails - Send order confirmations, password resets, and account notifications with template support and delivery tracking
- SMS verification codes - Deliver authentication codes and account validation messages with webhook-based status updates
- Email campaigns with templates - Use Brevo's template system with dynamic parameters for personalized messaging at scale
- Reliable notification delivery - Queue critical notifications with automatic retry logic and status monitoring for mission-critical communications
- Development testing - Test email and SMS flows in sandbox mode without sending real messages during development
How it works
From the upstream package documentation.
The component wraps Brevo's REST API endpoints (/v3/smtp/email and /v3/transactionalSMS/send) with Convex's durable execution model. You configure it with your Brevo API key and webhook secrets, then register it in convex.config.ts to make it available across your functions.
Email and SMS sending happens through the sendEmail() and sendSms() methods, which accept Brevo-native payloads including sender, recipients, content, and template parameters. The component queues these requests and handles rate limiting automatically while storing message status in internal Convex tables.
Webhook integration provides real-time status tracking by correlating Brevo's message-id values with your queued messages. You mount HTTP endpoints for /brevo-webhook and /brevo-sms-webhook that authenticate using shared secrets. The component provides status query methods like status() and smsStatus() plus cancellation capabilities for managing message delivery.
Upstream package FAQ
How does the convex-brevo component handle email delivery failures?
The convex-brevo component uses Convex's durable queueing system to automatically retry failed email sends. You can query delivery status, cancel pending emails, or use sendEmailManually for custom retry logic while maintaining status tracking in component tables.
Can I test emails without sending them using convex-brevo?
Yes, the convex-brevo component supports sandboxMode which validates email requests without sending real emails. Set sandboxMode: true in the Brevo constructor to use Brevo's X-Sib-Sandbox: drop header for testing.
What webhook configuration is needed for SMS tracking with convex-brevo?
The convex-brevo component requires BREVO_SMS_WEBHOOK_BASE_URL environment variable and smsWebhookBaseUrl in the constructor for SMS tracking. This allows the component to attach per-message webhook URLs to correlate delivery events with sent SMS messages.
How do I send both HTML and plain text emails with convex-brevo?
The convex-brevo component accepts both htmlContent and textContent in the sendEmail payload. You can provide either or both formats, and the component passes them directly to Brevo's native email API for multi-format delivery.
What rate limiting does convex-brevo provide for Brevo API calls?
The convex-brevo component implements rate-limited delivery for both email and SMS through Convex's workpool system. This prevents API quota violations while maintaining reliable delivery through durable queueing and automatic retries.
Use with agents and CLI
Give your coding agent the component’s source identity and setup guidance.
Help me integrate Brevo with Bijection.
Read: https://bijection.com/components/brevo/SKILL.md
Check SDK compatibility and dependency availability.
Follow this project's execution and verification rules.Upstream README.md
View repository ↗Documentation from pierre-H/convex-brevo, recorded October 23, 2026. APIs and setup may differ in the Bijection adaptation.
Brevo Convex Component
This component integrates Brevo transactional email and SMS with Convex.
Features
- Durable queueing with Convex mutations and workpools
- Rate-limited Brevo delivery via
POST /v3/smtp/email - Rate-limited Brevo delivery via
POST /v3/transactionalSMS/send - Brevo-native payloads:
sender,to,templateId,params,htmlContent,textContent - Transactional SMS payloads:
sender,recipient,content,tag sandboxModesupport viaX-Sib-Sandbox: drop- Webhook-driven status tracking using Brevo
message-id - Email status queries, cancellation, and manual-send fallback
- SMS status queries, cancellation, and manual-send fallback
Configuration
Set these environment variables in Convex:
BREVO_API_KEYBREVO_WEBHOOK_SECRETBREVO_SMS_WEBHOOK_BASE_URL(optional)BREVO_SMS_WEBHOOK_SECRET(optional, defaults toBREVO_WEBHOOK_SECRET)
Register the component in convex/convex.config.ts:
import { defineApp } from "convex/server";
import brevo from "convex-brevo/convex.config.js";
const app = defineApp();
app.use(brevo);
export default app;
Usage
import { components } from "./_generated/api";
import { Brevo } from "convex-brevo";
export const brevo = new Brevo(components.brevo, {
sandboxMode: true,
smsWebhookBaseUrl: process.env.BREVO_SMS_WEBHOOK_BASE_URL,
});
await brevo.sendEmail(ctx, {
sender: { email: "sender@example.com", name: "Sender" },
to: [{ email: "recipient@example.com", name: "Recipient" }],
subject: "Hello from Brevo",
htmlContent: "<p>It works.</p>",
tags: ["welcome"],
});
Template example:
await brevo.sendEmail(ctx, {
sender: { email: "sender@example.com", name: "Sender" },
to: [{ email: "recipient@example.com" }],
templateId: 42,
params: {
FIRST_NAME: "Ada",
ORDER_ID: 1234,
},
});
SMS example:
await brevo.sendSms(ctx, {
sender: "MyShop",
recipient: "33680065433",
content: "Enter this code: CAAA08",
tag: "accountValidation",
});
Webhooks
Mount an HTTP endpoint and protect it with the shared secret.
import { httpRouter } from "convex/server";
import { httpAction } from "./_generated/server";
import { brevo } from "./mail";
const http = httpRouter();
http.route({
path: "/brevo-webhook",
method: "POST",
handler: httpAction(async (ctx, req) => {
return await brevo.handleBrevoEventWebhook(ctx, req);
}),
});
http.route({
path: "/brevo-sms-webhook",
method: "POST",
handler: httpAction(async (ctx, req) => {
return await brevo.handleBrevoSmsWebhook(ctx, req);
}),
});
export default http;
The handler accepts the secret in either:
- query param
?secret=... - header
x-webhook-secret
Brevo IP whitelisting is still recommended.
For SMS tracking, set smsWebhookBaseUrl so the component can attach a
per-message webUrl to Brevo SMS sends.
Status API
const emailId = await brevo.sendEmail(ctx, { ... });
const status = await brevo.status(ctx, emailId);
const fullEmail = await brevo.get(ctx, emailId);
await brevo.cancelEmail(ctx, emailId);
const smsId = await brevo.sendSms(ctx, { ... });
const smsStatus = await brevo.smsStatus(ctx, smsId);
const fullSms = await brevo.getSms(ctx, smsId);
await brevo.cancelSms(ctx, smsId);
Manual sends
Use sendEmailManually or sendSmsManually when you need a custom Brevo call
while still storing status in the component tables.
Notes
sandboxModevalidates requests without sending real email.- The current implementation keeps the Convex queueing architecture and uses durable single-message Brevo API calls.
- Emails are correlated through Brevo
message-idvalues stored in the component tables. - SMS events are correlated either through the generated
smsIdin the webhook URL or by BrevomessageIdfallback when nosmsWebhookBaseUrlis used.
Legal disclaimer
This project is an unofficial community integration. It is not affiliated, associated, authorized, endorsed by, or in any way officially connected with Brevo SAS. "Brevo" is a registered trademark belonging to its respective owners.