Brevo

Send transactional emails and SMS through Brevo with durable queueing, webhook-driven status tracking, and rate limiting built on Convex.

Installation

npm install convex-brevo

About Brevo

A Brevo component for Convex.

Benefits

Use cases

how to send transactional emails from Convex with delivery tracking

The convex-brevo component provides sendEmail() to queue emails through Brevo's API with automatic status tracking via webhooks. You can query delivery status, cancel pending emails, and handle failures without external infrastructure.

Brevo SMS API integration with Convex backend

Use brevo.sendSms() to send transactional SMS messages with automatic queueing and webhook-based delivery tracking. The component handles rate limiting and provides status queries for SMS delivery confirmation.

email template integration with Brevo and Convex

Send templated emails by passing templateId and params to brevo.sendEmail(). The component supports Brevo's native template system with parameter substitution while maintaining delivery tracking and queue durability.

webhook handling for Brevo email delivery status

Mount HTTP endpoints using brevo.handleBrevoEventWebhook() to receive delivery status updates. The component automatically correlates webhook events with sent messages using Brevo message-id values for real-time status tracking.

Frequently asked questions

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.

Links