Registry / storage / grapesjs-indexeddb

grapesjs-indexeddb

JSON →
library1.0.5jsnpmunverified

IndexedDB storage wrapper plugin for GrapesJS, v1.0.5. Enables persistent project storage using IndexedDB in the browser, supporting multiple projects per page via configurable keys. Release cadence is low; last update appears minor. Differentiator: provides an alternative to localStorage or remote storage for larger projects, with configurable database name and object store. Requires GrapesJS v0.19.* or higher. ESM-compatible but also available as UMD.

npm install grapesjs-indexeddb
INSTALL
IMPORT
SIG · GRAPESJS-INDEXEDDB
G
grapesjs-indexeddb
storagejavascriptv1.0.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

grapesjs-indexeddb (plugin)
import grapesjsIndexeddb from 'grapesjs-indexeddb';
const grapesjsIndexeddb = require('grapesjs-indexeddb');
ESM default import; CommonJS require works in Node but not in browser without bundler. Plugin is registered by name 'grapesjs-indexeddb' in GrapesJS plugins.
Plugin usage via CDN
<script src="https://unpkg.com/grapesjs-indexeddb"></script>
<script src="https://unpkg.com/grapesjs-indexeddb@latest"></script>
CDN URL without version tag loads latest stable; always pin a version in production.
Register plugin with options
grapesjs.init({ plugins: ['grapesjs-indexeddb'], pluginsOpts: { 'grapesjs-indexeddb': { options: { key: 'my-project' } } } });
grapesjs.init({ plugins: ['indexeddb'], pluginsOpts: { 'indexeddb': {} } });
Plugin name in plugins array must be exactly 'grapesjs-indexeddb'. The options object key must also match that name.

Complete HTML page that loads GrapesJS and the IndexedDB plugin, then initializes the editor with IndexedDB storage using custom DB name and project key.

<html> <head> <link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet"/> <script src="https://unpkg.com/grapesjs"></script> <script src="https://unpkg.com/grapesjs-indexeddb"></script> </head> <body> <div id="gjs"></div> <script> const editor = grapesjs.init({ container: '#gjs', plugins: ['grapesjs-indexeddb'], storageManager: { type: 'indexeddb' }, pluginsOpts: { 'grapesjs-indexeddb': { options: { key: 'my-editor-project', dbName: 'editorDB', objectStoreName: 'projects', } } } }); </script> </body> </html>
Debug
Known issues
breakingRequires GrapesJS v0.19.* or higher. Older versions of GrapesJS may not work with this plugin.
fix
Upgrade GrapesJS to v0.19.0 or later.
affects: <0.19.0
gotchaThe plugin only provides the 'indexeddb' storage type. You must set storageManager.type to 'indexeddb' (or your custom type via plugin option) to enable it.
fix
Set storageManager: { type: 'indexeddb' } in GrapesJS config.
affects: >=1.0.0
deprecatedThe option 'key' is used to identify projects. In versions <1.0.3, using the same key across different pages could cause data collisions.
fix
Use unique keys per project or upgrade to 1.0.3+ where documentation clarifies this.
affects: <1.0.3
gotchaIndexedDB may be blocked or disabled in some browsers (e.g., private browsing modes). The plugin does not provide a fallback storage.
fix
Implement a fallback storage manager or check IndexedDB availability before relying solely on this plugin.
affects: >=1.0.0
Errors
Common errors & fixes
Uncaught TypeError: Cannot read properties of undefined (reading 'getStorageOptions')
The plugin is not in the plugins array but the storageManager type is set to 'indexeddb'.
fix
Add 'grapesjs-indexeddb' to the plugins array in GrapesJS init config.
Failed to execute 'open' on 'IDBFactory': The user agent does not support IndexedDB.
Browser does not support IndexedDB (rare) or is in a mode that blocks it (e.g., private browsing with restrictions).
fix
Check IndexedDB availability before initializing GrapesJS, or use a different storage manager.
Error: Storage type 'indexeddb' not found.
Plugin not loaded or registered correctly; the storage manager cannot find the 'indexeddb' type.
fix
Ensure the plugin script is loaded and added to plugins array. If using custom type via plugin option, set storageManager.type accordingly.
Upgrade
Version history
1.0.5latest on npm
Audit
Dependencies
grapesjsrequiredPlugin requires GrapesJS editor runtime
Agent activity
20 hits · last 30 days
node
20
Resources
grapesjs-indexeddb — npm install grapesjs-indexeddb · libregistry