Installation
Which GoTipe packages to install, their peer dependencies, styles and how the WASM engine is loaded.
GoTipe ships as a set of packages. Install the ones for your setup, import the styles if you use the ready UI, and configure the bundler only if you want the WASM engine.
Pick your packages
Ready editor for React (BlockEditor and PageEditor):
npm install @gotipe/block-editor @gotipe/core @gotipe/react @gotipe/theme @gotipe/i18n @gotipe/markdown @gotipe/suggestions react react-dompnpm add @gotipe/block-editor @gotipe/core @gotipe/react @gotipe/theme @gotipe/i18n @gotipe/markdown @gotipe/suggestions react react-domyarn add @gotipe/block-editor @gotipe/core @gotipe/react @gotipe/theme @gotipe/i18n @gotipe/markdown @gotipe/suggestions react react-dombun add @gotipe/block-editor @gotipe/core @gotipe/react @gotipe/theme @gotipe/i18n @gotipe/markdown @gotipe/suggestions react react-domHeadless editor for React, with your own interface:
npm install @gotipe/core @gotipe/react react react-dompnpm add @gotipe/core @gotipe/react react react-domyarn add @gotipe/core @gotipe/react react react-dombun add @gotipe/core @gotipe/react react react-domHeadless editor for Vue:
npm install @gotipe/core @gotipe/vue vuepnpm add @gotipe/core @gotipe/vue vueyarn add @gotipe/core @gotipe/vue vuebun add @gotipe/core @gotipe/vue vueServer rendering, conversion scripts and tests in Node need only the core:
npm install @gotipe/corepnpm add @gotipe/coreyarn add @gotipe/corebun add @gotipe/coreAdd @gotipe/wasm when you want the Rust engine, for example for collaboration:
npm install @gotipe/wasmpnpm add @gotipe/wasmyarn add @gotipe/wasmbun add @gotipe/wasmEvery package ships ES modules, CommonJS and TypeScript types; @gotipe/wasm and @gotipe/export-wasm are ES modules only. You don't need @types packages. The entries of a package share one copy of its code in both formats, so an error raised through @gotipe/core/js or @gotipe/core/server is an instanceof GoTipeError from @gotipe/core.
Peer dependencies
| Package | Peer dependencies |
|---|---|
@gotipe/core |
@gotipe/wasm (optional) |
@gotipe/react |
@gotipe/core, react ≥ 18, react-dom ≥ 18 |
@gotipe/vue |
@gotipe/core, vue ≥ 3.4 |
@gotipe/svelte |
@gotipe/core, svelte ≥ 5 |
@gotipe/solid |
@gotipe/core, solid-js ≥ 1.8 |
@gotipe/ |
@gotipe/core, @gotipe/react, @gotipe/theme, @gotipe/i18n, @gotipe/, @gotipe/, react ≥ 18, react-dom ≥ 18; shiki ^1.22 (optional, code highlighting) |
@gotipe/ai-ui |
@gotipe/ai, @gotipe/core, react ≥ 18, react-dom ≥ 18 |
@gotipe/export |
@gotipe/core; @gotipe/ (optional, PDF and DOCX) |
@gotipe/ai, @gotipe/, @gotipe/, @gotipe/, @gotipe/, @gotipe/i18n, @gotipe/, @gotipe/theme |
@gotipe/core |
@gotipe/, @gotipe/sdk, @gotipe/wasm, @gotipe/ |
none |
Styles
The ready UI draws with two style sheets from @gotipe/theme. Import both once, before your own CSS:
import "@gotipe/theme/base.css";
import "@gotipe/theme/theme.css";| File | Contents |
|---|---|
@gotipe/ |
The document: text, headings, lists, tables, code, in every view |
@gotipe/ |
Menus, panels, review cards, loading and error states |
@gotipe/ |
Both files above in one import |
@gotipe/ |
Only the --gt-* design tokens |
The headless adapters ship no CSS. EditorContent renders semantic HTML (p, h1–h6, ul, ol, table, pre) inside .gotipe-content, with data-block-id and data-block-type on every block, so you can style it yourself.
@gotipe/theme is a commercial package. If you use only MIT packages, write your own styles for .gotipe-content. Colours and sizes are covered in theming.
The WASM engine
createEditor from @gotipe/core with engine: "auto" (the default) or "wasm" imports @gotipe/wasm on demand. The module finds its binary with new URL("gotipe_wasm_bg.wasm", import.meta.url) and fetches it, so your bundler must emit gotipe_wasm_bg.wasm as an asset next to the loader.
Vite does this in production builds. In the dev server, exclude the package from dependency pre-bundling so the URL still points at the real file:
import { defineConfig } from "vite";
export default defineConfig({
optimizeDeps: {
exclude: ["@gotipe/wasm"],
},
});Other things to check:
- Serve
.wasmfiles asapplication/wasm. With another type the loader falls back to a slower instantiation and logs a warning. - Under a Content Security Policy the WASM engine needs
'wasm-unsafe-eval'inscript-src, andconnect-srcmust allow the binary's URL. The JS engine needs neither. See security. - If your bundler can't emit the asset, load the binary yourself; see Engines.
JS-only builds
@gotipe/core/js has the same API as @gotipe/core with the JS engine only. Nothing in it references @gotipe/wasm, so the bundle contains no WebAssembly and the editor runs under script-src 'self'. PageEditor always uses this entry.
Adapters such as @gotipe/react import @gotipe/core. To keep WASM out of the whole bundle, alias the exact specifier; subpaths such as @gotipe/core/presets stay as they are:
import { defineConfig } from "vite";
export default defineConfig({
resolve: {
alias: [{ find: /^@gotipe\/core$/, replacement: "@gotipe/core/js" }],
},
});Without @gotipe/wasm installed and without the alias, engine: "auto" falls back to the JS engine and logs a warning; pass engine: "js" to skip the attempt. A bundler that fails on the unresolved optional import needs the alias.
Node
The core runs in Node for server rendering, scripts and tests. @gotipe/core/server and @gotipe/core/js use the JS engine and need no DOM. createEditor from @gotipe/core runs the Rust engine in Node too: the node export condition of @gotipe/wasm reads the binary from the installed package, so engine: "auto" and engine: "wasm" need no loader of your own. See loading the binary.
Pass documents as JSON in Node: HTML import uses the browser's DOMParser and throws PARSE_ERROR without it. See content formats.