# FAQ

> Fabric.js FAQ: how to save a canvas as JSON, add undo redo, keep custom properties, use React and export images with this document engine.

Source: https://fabricjs-document-engine.jscrate.dev/docs/overview/faq
Last updated: 2026-09-28

This Fabric.js FAQ answers the questions developers search for most. Each answer links to the page that covers it in depth.

## How do I save a canvas as JSON and load it back?

Call `engine.toDocument()` to save a canvas as JSON, and `engine.loadDocument(json)` to load it. With a storage adapter, use `engine.save()` and `engine.load(id)`. See [save and load](https://fabricjs-document-engine.jscrate.dev/docs/guides/save-and-load).

## Does Fabric.js have undo redo?

No. Fabric.js has no built-in history. This package records one undo redo step per user action, and you call `engine.undo()` and `engine.redo()`. See [undo and redo](https://fabricjs-document-engine.jscrate.dev/docs/guides/undo-redo).

## Why are my custom properties lost after loading?

Fabric.js only saves the properties it knows. Register your class with the extra properties, and the engine keeps them on every save and load. See [custom objects](https://fabricjs-document-engine.jscrate.dev/docs/guides/custom-objects).

## How do I find an object by id?

Every object gets a stable `id`. Call `engine.getObjectById(id)`. It also finds objects inside groups.

## Can I use it with React, Vue or Svelte?

Yes. React has its own hooks in `fabricjs-document-engine/react`. Vue, Svelte and other frameworks use `createDocumentStateStore(engine)`. See [React](https://fabricjs-document-engine.jscrate.dev/docs/frameworks/react), [Vue](https://fabricjs-document-engine.jscrate.dev/docs/frameworks/vue) and [Svelte](https://fabricjs-document-engine.jscrate.dev/docs/frameworks/svelte).

## Does it work with Next.js?

Yes. The React entry is marked `'use client'`. Fabric.js needs a browser, so render the editor in a client component. See [Next.js](https://fabricjs-document-engine.jscrate.dev/docs/frameworks/next-js).

## Which Fabric.js versions are supported?

Fabric.js 6 and 7. Plain JSON saved by Fabric.js 5 also opens. See [compatibility](https://fabricjs-document-engine.jscrate.dev/docs/production/compatibility).

## Do I need a server?

No. The built-in localStorage adapter works without one. For a real app, write a storage adapter for your own API with two functions. See [custom backend](https://fabricjs-document-engine.jscrate.dev/docs/storage/custom-backend).

## Why does export fail with a tainted canvas error?

An image from another site was loaded without CORS. The engine checks this before exporting and names the image. See [export](https://fabricjs-document-engine.jscrate.dev/docs/guides/export).

## Can two people edit at the same time?

Not live. The engine detects when another tab or device saved first, and lets the user reload or keep their version. See [save conflicts](https://fabricjs-document-engine.jscrate.dev/docs/guides/save-conflicts).

## Is it free?

Yes. It is MIT licensed. If this Fabric.js FAQ did not answer your question, [open an issue on GitHub](https://github.com/re-sohail/fabricjs-document-engine/issues).
