> ## Documentation Index
> Fetch the complete documentation index at: https://revise.io/developer/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install from npm. Free for evaluation, personal projects, and education.

The SDK is the `@reviseio/editor` package on the public npm registry.
Installing it requires no account or token.

```bash theme={null}
npm i @reviseio/editor
```

npm and pnpm install the peer dependencies (React, `yjs`, `y-protocols`)
automatically. On Yarn, list them: `yarn add @reviseio/editor yjs y-protocols`. For `@reviseio/editor/server`
in Node, also run `npm i jsdom`.

`@reviseio/editor` is free for evaluation, personal projects, and education. Production
use by businesses, nonprofits, and government requires a
[commercial license](/developer/docs/developer/docs/editor-sdk/license). Building and prototyping are free.

## Entry points

| Import | What it is |
| - | - |
| `@reviseio/editor` | The React editor. `import ReviseEditor from "@reviseio/editor"`. |
| `@reviseio/editor/full` | The same editor plus Tree-sitter syntax highlighting and the WASM hot paths. Not CSP-safe; opt in if needed. |
| `@reviseio/editor/server` | Node-side conversion and the deterministic semantic tools over a host-owned Y.Doc. |
| `@reviseio/editor/style.css` | The stylesheet. Import it once. |
| `@reviseio/editor/version` | Build identity (`REVISE_SDK_VERSION`, `REVISE_SDK_BUILD`) alone. No runtime weight. |

## Peer dependencies

React 18 or newer, `yjs`, and `y-protocols` are required peers. The SDK does
not bundle its own copies. Every editor session uses Yjs, with or without a
collaboration provider.

| Package | Needed for |
| - | - |
| `yjs`, `y-protocols` | All editor sessions; [collaboration](/developer/docs/developer/docs/editor-sdk/guides/collaboration) also passes host-created Yjs objects, so your bundler must resolve exactly one copy |
| `jsdom` | `@reviseio/editor/server`, the Node-side document primitives |

`jsdom` is optional and never installed automatically. Only `@reviseio/editor/server`
needs it, and it prints an `npm i jsdom` hint if it is missing.

React is a required peer even when you use only `@reviseio/editor/server`, so npm
installs it in a Node-only project too. `@reviseio/editor/server` never loads it.

## Bundle size

The editor is a word processor, with DOCX, layout, and PDF export, and its main
chunk is about 2.7 MB minified (about 800 KB gzipped). Load it where a document
opens rather than in your entry bundle; see [load on
demand](/developer/docs/developer/docs/editor-sdk/quickstart#load-on-demand). Converters, PDF export, math,
and locales load separately, when first used.

Vite warns about any chunk over 500 kB. For the editor that warning is
expected. Raise the limit if you want a clean build:

```ts vite.config.ts theme={null}
export default defineConfig({
  build: { chunkSizeWarningLimit: 3000 },
});
```

## Versioning

The package follows semantic versioning. Pin what you ship:

```json package.json theme={null}
{
  "dependencies": {
    "@reviseio/editor": "2.3.0"
  }
}
```

Use an exact version, not a range. The package ships a `CHANGELOG.md`. Read
it before changing versions. Breaking changes to the component props or the
handle controllers ship only in major versions.

## Migrate from `revise`

Through 2.2, the SDK was published as `revise`. From 2.3 it is
`@reviseio/editor`: the same editor, license, and API under a new name. Replace
the dependency and update imports:

```bash theme={null}
npm uninstall revise && npm i @reviseio/editor
```

| Before (`revise` 2.x) | After |
| - | - |
| `revise/editor` | `@reviseio/editor` |
| `revise/editor/full` | `@reviseio/editor/full` |
| `revise/server` | `@reviseio/editor/server` |
| `revise/style.css` | `@reviseio/editor/style.css` |
| `revise` (version) | `@reviseio/editor/version` |

Nothing else changes. If your bundler config names the package (for example
Vite's `optimizeDeps.exclude`), rename it there too. The 2.2 and earlier docs
stay available from the version menu.

## Migrate from `@reviseio/sdk`

The private `@reviseio/sdk` package is retired. Replace the dependency with
`@reviseio/editor`, delete the `@reviseio` registry and token lines from
`.npmrc` (`@reviseio/editor` is on the public registry), and update imports:

| Before | After |
| - | - |
| `@reviseio/sdk` | `@reviseio/editor` |
| `@reviseio/sdk/full` | `@reviseio/editor/full` |
| `@reviseio/sdk/backend` | `@reviseio/editor/server` |
| `@reviseio/sdk/style.css` | `@reviseio/editor/style.css` |

The named `ReviseEditor` export still works alongside the default export.

## Report a problem

Include the SDK version and build. Both are exported, so your error reporting
can attach them:

```ts theme={null}
import { REVISE_SDK_VERSION, REVISE_SDK_BUILD } from "@reviseio/editor/version";
// "2.3.0", "f7dc7173"
```

`npm bugs @reviseio/editor` opens the [support](/developer/docs/developer/docs/editor-sdk/support) route.

## Assets

The SDK loads some static assets on demand instead of bundling them:

* PDF export fonts, including the CJK and world-script faces
* math fonts and stylesheet
* the PDF reader's worker
* Tree-sitter grammars (`@reviseio/editor/full` only)

By default they load from `https://revise.io`. A strict Content Security Policy
must allow that origin in `connect-src`, `font-src`, `style-src`, and
`worker-src`.

To serve them yourself, mirror these paths from `https://revise.io` to your
origin with the same layout:

* `fonts/`
* `katex.min.css`
* `pdfjs/`
* `tree-sitter/` (only for `@reviseio/editor/full`)

Then set the base URL once at startup:

```ts theme={null}
import { setAssetBaseUrl } from "@reviseio/editor";

setAssetBaseUrl("https://assets.example.com/revise");
```

## Troubleshooting

<AccordionGroup>
  <Accordion title="ERESOLVE peer dependency errors">
    The package requires React 18 or newer. Installing on React 17 or earlier
    fails.
  </Accordion>

  <Accordion title="Unexpected content type in insert operation">
    Two copies of Yjs are loaded. Make your bundler resolve a single `yjs`, for
    example with a `resolve.dedupe` entry in Vite.
  </Accordion>

  <Accordion title="Installed revise instead">
    The SDK was published as `revise` through 2.2 and is `@reviseio/editor`
    from 2.3. See [Migrate from `revise`](#migrate-from-revise).
  </Accordion>
</AccordionGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.