Installation
Install the edytor package in a Svelte 5 project and check the requirements for the editor, the CRDT entries and the server room.
Edytor ships as one npm package, edytor. It contains the <Edytor> component, the bundled plugins, the collaborative document API and its CRDT engine, and a Cloudflare Durable Object room.
Requirements
- Svelte 5.
svelteis a peer dependency (^5.0.0). The editor uses runes and snippets, so Svelte 4 is not supported. - A Svelte-aware bundler. The root entry ships
.sveltefiles. SvelteKit, or Vite with@sveltejs/vite-plugin-svelte, compiles them for you. - Node.js 22 or later (the package’s
enginesfield).
Install
The pre-release is not on npm yet. This site hosts its tarball; install it by URL:
npm install https://edytor-docs.beynar.workers.dev/edytor-0.1.0-next.0.tgzpnpm add https://edytor-docs.beynar.workers.dev/edytor-0.1.0-next.0.tgzyarn add https://edytor-docs.beynar.workers.dev/edytor-0.1.0-next.0.tgzbun add https://edytor-docs.beynar.workers.dev/edytor-0.1.0-next.0.tgznub add https://edytor-docs.beynar.workers.dev/edytor-0.1.0-next.0.tgzaube add https://edytor-docs.beynar.workers.dev/edytor-0.1.0-next.0.tgzThe tarball is the package exactly as it will be published (pnpm pack of this release). Once the pre-release is on npm, install it by its tag instead: pnpm add edytor@next. Name the tag: a bare edytor resolves to the old 0.0.11.
If your project does not have Svelte yet, add it too:
npm install -D sveltepnpm add -D svelteyarn add -D sveltebun add -D sveltenub add -D svelteaube add -D svelteDo not install yjs for Edytor. The collaboration engine (a fork of Yjs v14) is vendored inside the package and is available as edytor/crdt. The yjs package on npm is v13, which cannot exchange updates with v14.
The package pulls in a few runtime dependencies on its own: Atlassian’s Pragmatic Drag and Drop (block handles), TanStack Highlight (code block highlighting) and lib0.
Build from source
To build the tarball yourself, use a local clone of the repository that has the arch-v2 branch, where this release is developed. master still holds 0.0.11, so check out the branch first:
cd edytor # your clone
git switch arch-v2
pnpm install
pnpm package # builds dist/
pnpm pack # writes edytor-0.1.0-next.0.tgz
Then, in your project, install the file:
npm install ../edytor/edytor-0.1.0-next.0.tgzpnpm add ../edytor/edytor-0.1.0-next.0.tgzyarn add ../edytor/edytor-0.1.0-next.0.tgzbun add ../edytor/edytor-0.1.0-next.0.tgznub add ../edytor/edytor-0.1.0-next.0.tgzaube add ../edytor/edytor-0.1.0-next.0.tgzVerify the install
Render an editor. It needs no setup:
<script lang="ts">
import { Edytor } from 'edytor';
</script>
<Edytor />
You should see one empty paragraph. Hover it to reveal its block handle (touch devices always show it). An empty document always starts with one block of the default type (paragraph). <Edytor> includes the rich text, image and arrow move plugins by default, so this is already a working rich text editor.