Build
Developer SDK
A BotForge module is a declaration, not executable code: you describe capabilities, permissions and workflow triggers, and the platform wires the dashboard, sidebar and Workflow Builder automatically.
Module SDK — manifest fields
Every module is described by a ModuleManifest (client-side declaration, src/modules/types.ts) that becomes a ModuleDefinition DB row the moment your submission is approved.
| Field | Type | Req | Description |
|---|---|---|---|
| moduleKey | string | ✅ | Unique kebab-case identifier, e.g. "acme-loyalty". Permanent. |
| name | string | ✅ | Human-readable name, max 80 chars. |
| description | string | ✅ | Min 50 chars. Appears on the marketplace listing. |
| version | string | ✅ | Semantic versioning: MAJOR.MINOR.PATCH |
| category | ModuleCategory | ✅ | COMMUNITY · MARKETING · ECOMMERCE · SUPPORT · AI · CRM · BOOKING · MEMBERSHIP · EDUCATION · ANALYTICS · ENGAGEMENT · FINANCE · UTILITY |
| capabilities[] | Capability[] | ✅ | At least one. Drives dashboard/sidebar/placement — see below. |
| permissions[] | Permission[] | Required permissions for module pages — see below. | |
| workflowTriggers[] | string[] | Events emitted by the module. Format: entity.event | |
| workflowActions[] | string[] | Step types added to the Workflow Builder. Format: verb_noun | |
| pricingType | PricingType | ✅ | FREE · MONTHLY · ONE_TIME · REVENUE_SHARE |
| minPlan | PlanTier | ✅ | FREE · STARTER · PRO · AGENCY · ENTERPRISE |
| visibility | ModuleVisibility | ✅ | PUBLIC · UNLISTED · PRIVATE |
| documentationUrl | URL | ✅ | Link to your module's documentation. |
| screenshots[] | URL[] | ✅ | At least 1 screenshot URL. |
Lifecycle & runtime context
A module implements BotModule<TConfig>: lifecycle hooks (install, uninstall, enable, disable, configure) plus runtime handlers. New multi-channel modules implement the normalized handlers (handleNormalizedMessage/Callback/Event), which receive platform-agnostic types and work across every channel; the Telegram-specific handlers remain for backward compatibility only.
Every handler receives a ModuleContext — the only door to the database, channel send, AI and knowledge base. Modules never touch Prisma directly, which is what makes tenant isolation structural rather than convention.
ModuleContext (src/modules/types.ts)
interface ModuleContext<TConfig> {
workspaceId: string;
botId: string;
config: TConfig;
platform: Platform;
send(channelId: string, msg: NormalizedOutbound): Promise<void>;
customer: ModuleCustomer | null;
setCustomerAttributes(patch: Record<string, unknown>): Promise<void>;
logOutbound(text: string, payload?: unknown): Promise<void>;
ai(args: { system?: string; prompt: string; maxTokens?: number }): Promise<string>;
knowledge(args: { query: string; topK?: number }): Promise<
{ content: string; score: number; sourceId: string; sourceName: string }[]
>;
prompt(name: string): Promise<string | undefined>;
}Capabilities reference
Choosing the right capabilities is the most important manifest decision — each one activates a dashboard section and sidebar group in every workspace where the module is installed. A module can declare multiple.
| Capability | Dashboard Section | Example use |
|---|---|---|
| commerce | Commerce Center | Shop, orders, payments |
| support | Support Center | Tickets, helpdesk |
| marketing | Marketing Hub | Broadcasts, campaigns |
| growth | Growth Center | Referrals, affiliates |
| community | Community Center | Welcome, polls, groups |
| engagement | Engagement | Gamification, loyalty |
| automation | Automation | Workflows, triggers |
| ai | AI Center | AI chat, analysis |
| developer | Developer Tools | APIs, webhooks, SDK |
| crm | CRM | Contacts, pipelines, leads |
| scheduling | Scheduling | Bookings, calendars, appointments |
| analytics | Analytics | Reports, dashboards, metrics |
| finance | Finance | Invoices, payments, accounting |
Permissions reference
Declare the permissions your module's dashboard pages require — the RBAC system enforces these on every request, not just at render time.
| view_analytics | Your module has analytics/reporting pages |
| manage_bots | Your module configures bot behavior |
| manage_modules | Your module manages other modules |
| view_customers | Your module shows customer data |
| manage_commerce | Your module handles orders/products |
| manage_broadcast | Your module sends messages |
| manage_tickets | Your module manages tickets |
| manage_referrals | Your module handles referrals |
| view_audit | Your module shows audit logs |
| manage_ai | Your module configures AI |
| manage_api | Your module uses API/webhook features |
Full role-to-permission matrix (9 workspace roles) is on the Enterprise page.
AI Asset SDK
The same submission form publishes AI assets via an asset type selector — AGENT, PROMPT, KNOWLEDGE_PACK, TOOL, CONNECTOR or INDUSTRY_TEMPLATE — instead of a parallel catalog. Selecting a non-module type forces category: "AI" and capabilities: ["ai"] (reusing the existing capability validator) and swaps the capability/trigger fields for a JSON payload editor. approveSubmission() publishes any asset type through the identical ModuleDefinition upsert — same review queue, same versioning, same 70/30 split. Details per asset type on AI Studio.
Workflow integration
Declare workflowTriggers[] (format: entity.event, e.g. booking.created) and workflowActions[] (format: verb_noun, e.g. award_points). Once your module is installed, the Workflow Builder queries the installed workspace's enabled modules, reads their declared triggers/actions, and merges them with the built-in baseline — no Workflow Builder code changes needed, ever. Full merge mechanics on the Workflow Engine page.
Marketplace submission
Submission validation, the review queue, versioning and the 70/30 revenue share are covered in full on the Marketplace page — this SDK page covers what you declare; that page covers what happens after you submit it.
Connector SDK & White Label SDK
Connectors (external REST/OAuth/webhook integrations an Agent's tools can call) have their own reference — see Connectors. White Label (custom domain, branding, outbound email for agencies) is documented on the White Label page.