Skip to content

Extension SDK

drawtonomy extensions are iframe-hosted web apps that talk to the editor through postMessage. The SDK gives you a typed client; the dev-server gives you a local editor to develop against.

This page is a quick orientation. The full guide — manifest schema, capabilities list, message protocol — is in the public repo:

Extension Development Guide (日本語)

Terminal window
# Editor on :3000
pnpm add -g @drawtonomy/dev-server
drawtonomy-dev-server
# Your extension on :3001
cd my-extension && pnpm dev --port 3001
open "http://localhost:3000/?ext=http://localhost:3001/manifest.json"
my-extension/
manifest.json
index.html
src/
manifest.json
{
"id": "my-extension",
"name": "My Extension",
"version": "1.0.0",
"entry": "./index.html",
"capabilities": ["shapes:read", "shapes:write", "ui:panel"]
}
src/main.ts
import { ExtensionClient, createVehicle } from '@drawtonomy/sdk'
const client = new ExtensionClient()
await client.ready()
document.getElementById('add')!.addEventListener('click', async () => {
await client.addShapes([createVehicle(0, 0, { templateId: 'sedan' })])
})

The in-tree extensions are full-fidelity examples: