Integration Overview

Understand how CodeCourier integrates with E2B, Trigger.dev, Clerk, Convex, and other services to deliver a complete AI workflow platform.

6 min read
integrationsoverviewe2b

CodeCourier is built on a carefully chosen set of third-party services, each providing a critical capability that would be impractical to build in-house. Rather than monolithic infrastructure, CodeCourier follows a composable architecture where each integration handles one concern exceptionally well. This page provides an overview of each integration, what it provides, and how the pieces fit together.

Integration Architecture

The platform's data flow can be understood in four layers:

  1. Authentication Layer (Clerk) -- Handles user sign-up, sign-in, session management, and identity. Clerk issues JWTs that Convex validates on every function call.
  2. Data Layer (Convex) -- The reactive database that stores all application state: users, projects, sandboxes, workflows, runs, messages, learnings, and usage records. Convex provides real-time subscriptions so the dashboard updates instantly when data changes.
  3. Execution Layer (E2B) -- Provides isolated cloud Linux virtual machines where AI coding agents run. E2B handles VM provisioning, file system access, process execution, and network management.
  4. Orchestration Layer (Trigger.dev) -- Manages long-running background jobs that coordinate the entire workflow: provisioning sandboxes, sending prompts, running designer-checker iterations, extracting learnings, and creating pull requests.

Available Integrations

E2B Sandboxes

E2B provides the isolated cloud execution environments that are the heart of CodeCourier. Every sandbox is an E2B micro-VM with its own Linux kernel, file system, and network stack. The E2B SDK (version 2.14+) is used for creating, connecting to, and managing sandbox lifecycles.

Read the E2B integration guide

Trigger.dev

Trigger.dev handles all background job processing. Workflow orchestration, work chain execution, issue sessions, issue discovery, learning extraction, and merge agent operations all run as Trigger.dev tasks. This keeps the Convex backend responsive while long-running AI operations execute asynchronously.

Read the Trigger.dev integration guide

Clerk Authentication

Clerk provides drop-in authentication with support for email and password, OAuth providers (Google, GitHub), and magic links. The @clerk/nextjs SDK (version 6+) integrates directly with the Next.js app router, and Clerk JWTs are passed to Convex for server-side identity verification.

Read the Clerk integration guide

Convex Database

Convex is the reactive database platform that powers all data storage and real-time features. Queries automatically re-execute when underlying data changes, mutations are transactional, and actions provide a way to call external services. The Convex schema defines all tables, indexes, and validation rules.

Read the Convex integration guide

How Integrations Are Configured

Each integration requires specific configuration, typically through environment variables. Here is a summary of what each integration needs:

Required Environment Variables

  • Convex -- CONVEX_DEPLOYMENT and NEXT_PUBLIC_CONVEX_URL are set automatically during project setup.
  • Clerk -- NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY and CLERK_SECRET_KEY from the Clerk dashboard. CLERK_WEBHOOK_SECRET for webhook verification.
  • Trigger.dev -- TRIGGER_SECRET_KEY for the Trigger.dev SDK, TRIGGER_CALLBACK_SECRET for secure callbacks to Convex.
  • E2B -- Users provide their own E2B API key through the dashboard, which is encrypted and stored in the database. No server-level E2B configuration is needed.

User-Provided API Keys

In addition to server-level configuration, individual users or projects can provide their own API keys for services that sandboxes use at runtime:

  • E2B API Key -- Required for sandbox provisioning.
  • Anthropic API Key or Token -- Required for Claude Code sandboxes.
  • OpenRouter API Key -- For OpenRouter-based model access.
  • OpenAI API Key -- For Codex and OpenAI-powered tools.
  • GitHub Token -- For repository operations within sandboxes.

These keys can be set at the user level (applying to all projects) or at the project level (overriding user-level keys for that specific project). All keys are encrypted before storage.

Integration Dependencies

The integrations have specific dependency relationships:

  • Clerk depends on Convex -- Clerk JWTs are validated by Convex. The user table in Convex stores the mapping between Clerk IDs and internal user IDs.
  • Trigger.dev depends on Convex -- All Trigger.dev tasks report progress back to Convex through the HTTP callback endpoint.
  • E2B depends on Trigger.dev -- Sandbox provisioning and management happen inside Trigger.dev tasks. E2B operations are never called directly from the browser.
  • Convex is the hub -- All other services communicate through Convex, making it the central data store and coordination point.

Package Versions

CodeCourier uses the following integration package versions (check package.json for the latest):

  • convex -- ^1.32.0
  • @clerk/nextjs -- ^6.39.0
  • e2b -- ^2.14.0
  • @trigger.dev/sdk -- 4.4.3
  • @trigger.dev/react-hooks -- 4.4.3
  • @anthropic-ai/sdk -- ^0.78.0