--- title: SDK Getting Started description: Set up @open-pencil/vue with createEditor, provideEditor, and a canvas. --- # SDK Getting Started ## Installation ```bash bun add @open-pencil/core @open-pencil/vue canvaskit-wasm ``` The SDK lives in the monorepo today and is also published as `@open-pencil/vue`. ```ts import { createEditor } from '@open-pencil/core/editor' import { provideEditor, useCanvas } from '@open-pencil/vue' ``` ## Mental model There are three layers: 1. `@open-pencil/core` — framework-agnostic editor engine 2. `@open-pencil/vue` — Vue composables and headless primitives 3. your app — styling, routing, file flows, product-specific UI ## Minimal setup ### 1. Create an editor ```ts import { createEditor } from '@open-pencil/core/editor' const editor = createEditor({ width: 1200, height: 800, }) ``` ### 2. Provide it to Vue ```vue ``` You can think of this as the provider layer for the editor tree. The docs prefer `provideEditor()` directly because that is the current real API surface. ### 3. Attach a canvas ```vue ``` ## Using composables Once the editor is provided, child components can read selection and issue commands: ```ts import { useEditorCommands, useSelectionState } from '@open-pencil/vue' const selection = useSelectionState() const commands = useEditorCommands() ``` ## Basic example ```vue ``` ## Next steps - [Architecture](./architecture) - [API Reference](./api/) - [useEditor](./api/composables/use-editor) - [useCanvas](./api/composables/use-canvas) - [useI18n](./api/composables/use-i18n)