BotForge

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.

FieldTypeReqDescription
moduleKeystringUnique kebab-case identifier, e.g. "acme-loyalty". Permanent.
namestringHuman-readable name, max 80 chars.
descriptionstringMin 50 chars. Appears on the marketplace listing.
versionstringSemantic versioning: MAJOR.MINOR.PATCH
categoryModuleCategoryCOMMUNITY · 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
pricingTypePricingTypeFREE · MONTHLY · ONE_TIME · REVENUE_SHARE
minPlanPlanTierFREE · STARTER · PRO · AGENCY · ENTERPRISE
visibilityModuleVisibilityPUBLIC · UNLISTED · PRIVATE
documentationUrlURLLink 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.

CapabilityDashboard SectionExample use
commerceCommerce CenterShop, orders, payments
supportSupport CenterTickets, helpdesk
marketingMarketing HubBroadcasts, campaigns
growthGrowth CenterReferrals, affiliates
communityCommunity CenterWelcome, polls, groups
engagementEngagementGamification, loyalty
automationAutomationWorkflows, triggers
aiAI CenterAI chat, analysis
developerDeveloper ToolsAPIs, webhooks, SDK
crmCRMContacts, pipelines, leads
schedulingSchedulingBookings, calendars, appointments
analyticsAnalyticsReports, dashboards, metrics
financeFinanceInvoices, 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_analyticsYour module has analytics/reporting pages
manage_botsYour module configures bot behavior
manage_modulesYour module manages other modules
view_customersYour module shows customer data
manage_commerceYour module handles orders/products
manage_broadcastYour module sends messages
manage_ticketsYour module manages tickets
manage_referralsYour module handles referrals
view_auditYour module shows audit logs
manage_aiYour module configures AI
manage_apiYour 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.