Codapult
FeaturesPricingAPIHelpChangelog
Codapult

Ship Your SaaS Faster

Product

  • Features
  • Pricing
  • Plugins
  • API Reference
  • Help Center
  • Feature Requests
  • Changelog

Company

  • Contact
  • GitHub

Legal

  • Privacy Policy
  • Terms of Service

© 2026 Codapult. All rights reserved.

All articles

Getting Started

  • Introduction
  • Quick Start
  • Project Structure

Configuration

  • Environment Variables
  • App Configuration

Authentication

  • Authentication

Database

  • Database

Teams

  • Teams & Organizations

Payments

  • Payments & Billing

Api

  • API Layer

Ai

  • AI Features

Email

  • Email

Infrastructure

  • Infrastructure

Ui

  • UI & Theming

I18n

  • Internationalization

Content Management

  • Content Management

Admin

  • Admin Panel

Security

  • Security

Monitoring

  • Analytics & Monitoring

Modules

  • Module Architecture

Plugins

  • Plugin System

Deployment

  • Deployment
  • Troubleshooting

Upgrading

  • Upgrading Codapult

Developer Tools

  • MCP Server
  • Testing
Plugins

Plugin System

How to extend Codapult with plugins — architecture, creating your own, and premium plugin catalog.

Overview

Codapult ships with a plugin system that lets you extend the platform without modifying core code. Plugins can add sidebar navigation, settings panels, API routes, and react to lifecycle events.

All plugins implement the CodapultPlugin interface from src/lib/plugins/types and are registered in codapult.plugins.ts.

Extension Points

ExtensionDescription
navItemsAdds items to the dashboard sidebar (icon, label, href, sort order)
settingsPanelsAdds tabs to the settings page (lazy-loaded React component)
apiRoutesMounts API routes at /api/plugins/<name>/ (GET, POST, PUT, PATCH, DELETE)
onInitOne-time setup hook, called when the plugin is first loaded
onUserCreatedFired after a new user registers
onUserDeletedFired after a user is deleted
onSubscriptionChangedFired when a subscription status changes
onPaymentCompletedFired when a one-time payment completes

Creating a Plugin

Step 1: Create the Plugin Directory

mkdir -p plugins/my-plugin/components

Plugin names must be kebab-case and match the directory name.

Step 2: Implement the Interface

Create plugins/my-plugin/index.ts:

import type { CodapultPlugin } from '@/lib/plugins/types';

const myPlugin: CodapultPlugin = {
  name: 'my-plugin',
  version: '1.0.0',
  description: 'Adds custom analytics to the dashboard',

  navItems: [
    {
      id: 'my-analytics',
      label: 'My Analytics',
      href: '/dashboard/my-analytics',
      icon: 'BarChart3',
      order: 50,
    },
  ],

  settingsPanels: [
    {
      id: 'my-plugin-settings',
      label: 'My Plugin',
      component: './components/Settings',
      order: 100,
    },
  ],

  apiRoutes: [
    {
      method: 'GET',
      path: '/stats',
      handler: async (req) => {
        return new Response(JSON.stringify({ visits: 42 }), {
          headers: { 'Content-Type': 'application/json' },
        });
      },
    },
  ],

  async onInit() {
    console.log('My plugin initialized');
  },

  async onUserCreated({ user }) {
    console.log(`New user: ${user.email}`);
  },

  async onSubscriptionChanged({ userId, plan, status }) {
    console.log(`Subscription changed: ${userId} → ${plan} (${status})`);
  },

  async onPaymentCompleted({ userId, amount, currency }) {
    console.log(`Payment received: ${amount} ${currency} from ${userId}`);
  },
};

export default myPlugin;

Step 3: Register the Plugin

Add your plugin to codapult.plugins.ts:

import { registerPlugin } from '@/lib/plugins';
import myPlugin from './plugins/my-plugin';

registerPlugin(myPlugin);

The plugin's nav items, settings panels, and API routes are now live. API routes are accessible at /api/plugins/my-plugin/stats.

Bundled Example

Codapult includes a reference plugin at plugins/example-analytics/ that demonstrates all extension points. Use it as a starting point for your own plugins.

Plugin Rules

  • Plugin name must be kebab-case and match the directory name.
  • API routes are automatically prefixed with /api/plugins/<name>/.
  • Never import plugin code from core — plugins depend on core, not the other way around.
  • Handle errors in hooks — the registry wraps onInit in try/catch, but lifecycle hooks should handle their own errors gracefully.
  • Settings panels are lazy-loaded — the component path is resolved relative to the plugin directory.

Premium Plugins

Four premium plugins are available separately. Each adds a full-featured module with its own UI, API, database tables, and AI capabilities.

PluginPackageDescription
AI Starter Kit@codapult/plugin-ai-kitAI gateway, prompt management, tool framework, guardrails
CRM@codapult/plugin-crmCompanies, contacts, deals pipeline, AI lead scoring
Helpdesk@codapult/plugin-helpdeskAI-native support tickets, SLA policies, auto-resolve via RAG
Email Marketing@codapult/plugin-email-marketingSubscriber lists, segmentation, broadcast campaigns, AI content

Installation

Install any premium plugin via the Codapult CLI:

npx @codapult/cli plugins add @codapult/plugin-ai-kit

Each plugin ships with its own README.md and INSTALL.md containing step-by-step installation instructions, required environment variables, and database migration commands.

Removal

Remove a premium plugin with:

npx @codapult/cli plugins remove @codapult/plugin-ai-kit

The CLI removes the plugin's files, unregisters it from codapult.plugins.ts, and cleans up database tables.

Module ArchitectureDeployment