Skip to main content

Overview

The plugin framework lets you add tools, panels, and data sources to the CDT app without modifying any core files. Plugins register their contributions into a central registry at startup; the toolbar, sidebar, and viewer read from that registry at render time. Core app code never changes — only the registry does.

Phase 1 scope

Plugins are bundled with the app at build time by listing them in installed.ts. Runtime dynamic loading (adding plugins without rebuilding) is not supported in this version.

In this section

  1. Create your first plugin — five-step walkthrough
  2. PluginContext APIpluginId, config, register
  3. All 11 capabilities — full capability table
  4. Error handling & safety — isolation, guards, cleanup
  5. Real example: daynight-cycle — annotated canonical plugin

Startup lifecycle — what happens when the app loads

Startup lifecycle — what happens when the app loads
1
App mounts
Core
Next.js / React
2
PluginHostProvider
Open
CombineProviders
3
Host loops plugins
Core
installed.ts
4
Validate manifest
Core
slug · caps · version
5
createPluginContext
Core
scoped to slug
6
activate(ctx) called
Open
your plugin runs
7
ctx.register() → registry
Files
contributions stored
8
Toolbar / Sidebar render
Map
reads registry

System structure — how the three zones relate

System structure — how the three zones relate
You write this
manifest.json
Declares your plugin's slug and capabilities. Validated before your code runs.
Open
index.ts — activate(ctx)
Your entry point. Calls ctx.register() to contribute UI or behaviour.
Open
Component files
React components passed into register(). Rendered by core UI at runtime.
Open
writes into
The framework
sdk/types.ts
The public contract. Defines every type a plugin author touches.
Files
host/host.ts
Validates manifests, builds contexts, calls activate(). Errors caught per-plugin.
Core
HUB
PluginRegistry
In-memory map of capability → contributions. The only shared state between plugins and core UI.
Files
reads from
Core app (unchanged)
Toolbar
Renders every registered tool button.
Map
map.toolsbim.toolspointcloud.tools
Sidebar
Renders navigation items.
Map
sidebar.items
Viewer
Renders floating overlay panels.
Map
viewer.panels
+ more
Additional contribution points.
Map
map.layersdata.collectionsjobscommandswidgets
Capability gating
A plugin only gets the APIs it declares in its manifest. Attempting to call ctx.register() with an undeclared capability throws at runtime.
All 11 capabilities
map.toolsbim.toolspointcloud.toolssidebar.itemsviewer.panelsmap.layersdata.collectionsdata.columnsjobscommandswidgets