convex-inbound

Drop-in Convex component that adds production-ready email sending and receiving with automatic retries, threading, and rate limiting.

Installation

npm install @hamzasaleemorg/convex-inbound

About convex-inbound

A drop-in Convex Component that adds full-stack email capabilities to your Convex app, powered by inbound.new.

Stop building email infra from scratch. This component gives you a production-ready email backend with one line of config.

Why use this Component?
Instead of just calling an API, this component runs inside your Convex backend:

⚡️ Durable Sending: Emails are queued and sent via background workers (Workpool). If the API fails, it retries automatically.
📩 Threaded Inbox: Inbound emails are stored directly in your database table with proper threading.
🛡️ Idempotency: Built-in protection against duplicate sends, even during heavy retries.
🚦 Rate Limiting: Automatically handles API limits so you never get 429s.
🔒 Type-Safe: Full TypeScript support for all events and methods.

Benefits

Use cases

how to add email sending to Convex app

The convex-inbound component provides email sending through Convex mutations and actions with automatic queuing. It handles retries, rate limiting, and stores email status in your database without external email service integration complexity.

Convex email webhook handling

This component automatically processes inbound email webhooks and stores them in your Convex database with proper message threading. It provides type-safe handlers for email events like delivery confirmations and replies.

reliable email sending with retry logic

The component uses Convex Workpool for durable email sending with automatic retries on failures. It includes idempotency protection to prevent duplicate sends and built-in rate limiting to avoid API errors.

email threading in Convex database

Inbound emails are automatically stored in your Convex tables with proper thread relationships. The component parses email headers and maintains conversation continuity for building email-based applications.

Frequently asked questions

Does convex-inbound work with existing Convex authentication?

Yes, convex-inbound integrates seamlessly with Convex auth. The component respects your existing authentication rules and can associate emails with authenticated users through your Convex functions.

How does the retry mechanism work for failed email sends?

The convex-inbound component uses Convex background workers to queue email sends. If an API call fails, it automatically retries with exponential backoff. The component includes idempotency keys to prevent duplicate sends during retries.

What email providers does this component support?

The convex-inbound component is powered by inbound.new, which handles the underlying email infrastructure. You don't need to configure separate email providers as the service manages sending and receiving through a unified API.

Can I customize email templates and sender addresses?

Yes, convex-inbound allows you to specify custom sender addresses and email content through its TypeScript API. The component provides type-safe methods for setting recipients, subjects, HTML content, and attachments.

How are inbound emails stored in my Convex database?

The convex-inbound component automatically creates database entries for received emails with fields for sender, recipients, subject, body, and thread information. It maintains proper message threading and provides queries for retrieving conversation history.

Links