Conduit
Conduit
Docsllms.txtHostingGitHubIntroduction

Getting Started

OverviewInstall ConduitMCP SetupYour First AppStart with AI

Learn

ArchitectureClient vs Admin APIConfiguration

Modules

OverviewAuthenticationAuthorizationDatabaseStorageCommunicationsChatRouterFunctions

Guides

Next.js IntegrationReBAC Team ScopingGitOps State Export

Deployment

Deployment OverviewDocker ComposeKubernetes and HelmLocal from SourceContainer Images

Reference

CLI ReferenceClient APIAdmin APIEnvironment VariablesMCP Tools

Resources

Migration v0.16 → v0.17Legacy DocumentationChangelogFAQGlossaryContributing

Functions

Admin-defined server-side JavaScript with grpcSdk access.

The functions module runs admin-defined JavaScript in-process with full grpcSdk access. Treat function code like server configuration — admin-trusted, not user-supplied.

Use cases

Webhooks

Receive Stripe/GitHub callbacks and call grpcSdk.database or grpcSdk.email

Event automation

React to bus events — send notifications when records change

Admin-only routes

Custom HTTP handlers registered on Admin API surface

Cross-module orchestration

Chain database writes, chat system messages, and email in one handler

Capabilities

  • In-process JS execution
  • grpcSdk access
  • Webhook handlers
  • Event bus subscribers
  • Admin HTTP routes
  • Database & comms integration

Example: Webhook handler concept

Walkthrough

  1. Admin defines a Function that exposes POST /hook/stripe (Admin API)
  2. Function validates webhook signature in JS
  3. On payment_intent.succeeded, grpcSdk.database finds Order and updates status
  4. grpcSdk.email sends receipt using a provisioned template
  5. Optional: grpcSdk.chat sends system message to order room
Conceptual handler (admin-defined JS — not Client API)
# Functions run on Admin API surface, configured via admin panel or MCP
# Example: webhook receives POST, calls grpcSdk internally
curl -X POST http://localhost:3030/function/stripeWebhook \
-H "Content-Type: application/json" \
-d '{"type":"payment_intent.succeeded","data":{...}}'

How it works

Trust boundary

Functions code is admin-trusted — equivalent to a custom module deployed by operators. It is not exposed to end users as arbitrary script upload. For user-facing filtered queries, use database custom endpoints at /database/function/{name} on the Client API instead.

grpcSdk access

Inside a function, grpcSdk provides typed clients for database, authentication, storage, chat, communications, and other registered modules — same as custom ManagedModule services.

When to use Functions vs custom modules

NeedUse
Filtered Client API queryDatabase custom endpoint
Long-running domain serviceCustom ManagedModule
Webhook, cron, one-off admin automationFunctions
System chat message from backendgrpcSdk.chat from Function or custom module

Configure

Define functions via Admin panel or MCP when the functions module is enabled. Each function specifies trigger type (HTTP route, bus event), source code, and enabled flag.

Client API

Functions do not replace Client API routes for app runtime. App code calls /database/function/{name} for provisioned queries — those are database custom endpoints, not this module.

MCP

Enable functions module in deployment. Admin tools manage function CRUD alongside other admin routes.

Next steps

  • Database custom endpoints
  • Communications (email from webhooks)
  • Admin API reference
  • Module authoring (custom modules)

Router

Client API gateway — REST, GraphQL, and WebSockets.

Next.js Integration

Auth vault, conduitRequest, API routes, and Client API patterns.

On this page

Use casesCapabilitiesExample: Webhook handler conceptHow it worksTrust boundarygrpcSdk accessWhen to use Functions vs custom modulesConfigureClient APIMCP