Revise Editor SDK menu

Installation

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

Install revise from npm (no account or registry token required):

npm i revise

npm and pnpm install peer dependencies (react, react-dom, yjs, y-protocols) automatically; Yarn requires listing yjs and y-protocols explicitly. revise/server is bundled in revise.

Free for evaluation, personal noncommercial projects, and education. Production use by businesses, nonprofits, and government requires a commercial license.

Entry points#

ImportDescription
reviseReact editor (import ReviseEditor from "revise").
revise/fullSame editor plus Tree-sitter syntax highlighting and wasmHotPaths acceleration. Not CSP-safe.
revise/style.cssEditor stylesheet. Import once.
revise/versionBuild identity (REVISE_SDK_VERSION, REVISE_SDK_BUILD) with no runtime weight.
revise/serverNode API, bundled in revise and covered by the SDK license.

Peer dependencies and runtime#

  • Browser editor: Requires React 18+, react-dom 18+, yjs (^13.6.0), and y-protocols (^1.0.6). Every session uses Yjs even without a collaboration provider; your bundler must resolve a single copy of yjs. Node 18+ for build tooling.
  • revise/server: ESM only, Node 20+. Does not import React; jsdom is declared as a direct dependency of revise, so no separate install is needed. The browser entry never imports revise/server.

Bundle size#

The main editor chunk is ~2.7 MB minified (~800 KB gzipped). Format converters, PDF export, math rendering, and locales are code-split and load on demand. Load the editor lazily rather than in your entry bundle (load on demand).

To silence Vite's 500 kB chunk warning:

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

Versioning#

revise follows semver. Pin an exact version in package.json and review CHANGELOG.md before upgrading:

package.json
{
  "dependencies": {
    "revise": "4.6.0"
  }
}

Upgrade from an earlier version#

Earlier releases shipped as @reviseio/editor. Replace the dependency with revise and update import paths (component props and handle APIs are unchanged):

npm uninstall @reviseio/editor
npm i revise@4.6.0
Earlier importCurrent import
@reviseio/editor, revise/editorrevise
@reviseio/editor/full, revise/editor/fullrevise/full
@reviseio/editor/versionrevise/version
@reviseio/editor/style.cssrevise/style.css
@reviseio/editor/serverrevise/server

Update any bundler references (such as Vite's optimizeDeps.exclude) to "revise". Earlier version docs remain in the version selector.

Server-side code#

Server-side code uses revise/server, built around ReviseDocument:

Earlierrevise/server
createServerDocumentSession(ydoc)ReviseDocument.fromYDoc(ydoc), then doc.tools
parseDocument, documentToDocx, fileToYDocReviseDocument.open(file), doc.export({ format: "docx" }), doc.ydoc
exportDocument(room, { mode }), ydocToDocx(room)ReviseDocument.fromYDoc(room), then doc.export({ format, mode })
seedYDocFromFile(room, bytes, filename)seedYDoc(room, { bytes, filename })
encodeYDoc, decodeYDocY.encodeStateAsUpdate(doc.ydoc); ReviseDocument.restore(update)

When porting: await ReviseDocument methods, check result.ok on tool calls instead of catching, and write bytes from doc.export(). doc.snapshot() uses Revise's own format; use Y.encodeStateAsUpdate(doc.ydoc) for Yjs transports.

Report a problem#

Attach version and build constants to error reports:

TypeScript
import { REVISE_SDK_VERSION, REVISE_SDK_BUILD } from "revise/version";
// "4.4.0", "f7dc7173"

Run npm bugs revise or see support.

Assets#

PDF export WebAssembly and PDF import worker/codecs are bundled directly inside revise and served from your own build automatically (and read from disk in revise/server).

Optional static assets load on demand from https://revise.io by default:

  • fonts/ — fallback PDF export fonts (including CJK and world scripts) when installed/local fonts cannot be embedded
  • katex.min.css — math stylesheet and KaTeX fonts
  • tree-sitter/ — syntax grammars (revise/full only)

Under a strict CSP, allow https://revise.io in connect-src, font-src, and style-src—or self-host them with the optional @reviseio/assets package:

Terminal
# Copies fonts/ and katex.min.css into your static public directory
npx @reviseio/assets copy public/revise

# Optional flags: --tree-sitter (for revise/full), --no-cjk (skip ~22 MB CJK fonts)

Then call setAssetBaseUrl() once at startup:

TypeScript
import { setAssetBaseUrl } from "revise";

setAssetBaseUrl("/revise");

@reviseio/assets is optional—pass setAssetBaseUrl(false) to disable remote asset fetches entirely if you rely on installed/web fonts and don't need KaTeX or Tree-sitter. See production deployment for the full zero-egress checklist.

Troubleshooting#

ERESOLVE peer dependency errors

revise requires React 18 or newer; React 17 and earlier are unsupported.

Unexpected content type in insert operation

Multiple copies of yjs are bundled. Deduplicate yjs in your bundler (for example, resolve.dedupe: ["yjs", "y-protocols"] in Vite).