Skip to content
Edytor
Esc
↑↓navigate↵open⌘Jpreview
On this page

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. svelte is 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 .svelte files. SvelteKit, or Vite with @sveltejs/vite-plugin-svelte, compiles them for you.
  • Node.js 22 or later (the package’s engines field).

Install

The pre-release is on npm under the next tag:

npm install edytor@next
pnpm add edytor@next
yarn add edytor@next
bun add edytor@next
nub add edytor@next
aube add edytor@next

Name the tag: a bare edytor resolves to the old, incompatible 0.0.11. Each pre-release is published from CI with npm provenance.

Earlier installs by URL keep working: this site still serves every pre-release tarball it hosted, each at its versioned URL, and the bytes under a URL never change, so a lockfile’s URL and integrity hash stay valid. Switch to edytor@next when you upgrade.

If your project does not have Svelte yet, add it too:

npm install -D svelte
pnpm add -D svelte
yarn add -D svelte
bun add -D svelte
nub add -D svelte
aube add -D svelte

Do 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, from a clone of the repository (master):

cd edytor           # your clone
pnpm install
pnpm package        # builds dist/
pnpm pack           # writes edytor-0.1.0-next.25.tgz

Then, in your project, install the file:

npm install ../edytor/edytor-0.1.0-next.25.tgz
pnpm add ../edytor/edytor-0.1.0-next.25.tgz
yarn add ../edytor/edytor-0.1.0-next.25.tgz
bun add ../edytor/edytor-0.1.0-next.25.tgz
nub add ../edytor/edytor-0.1.0-next.25.tgz
aube add ../edytor/edytor-0.1.0-next.25.tgz

Verify 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, arrow move and suggestions plugins by default, so this is already a working rich text editor.

Next steps

Was this page helpful?