CLIActive

Plasmo Browser Platform Publisher

Plasmo Browser Platform Publisher: Welcome Introduction to Plasmo Welcome to Plasmo, the all-in-one platform that makes it easy for browser extension developers to create, test, and publish amazing extensions.

Open source page ↗

Field note

What it does

Framework Storage Storage API @plasmohq/storage is a utility library from plasmo (opens in a new tab) that abstracts the persistent storage API available to browser extensions. It falls back to localStorage when the extension storage API is unavailable, allowing for state sync between extension pages, content scripts, background service workers and web pages. This library will enable the storage permission automatically if used as a dependencies in a Plasmo framework (opens in a new tab) project Installation pnpm install @plasmohq/storage The package exports the following modules, in both ESM and CJS format: Modules Description @plasmohq/storage The base Storage API @plasmohq/storage/secure The SecureStorage API @plasmohq/storage/hook The React Hook Storage API Usage Examples See with-storage (opens in a new tab) for an example of how to use this library to sync state between options and popups. See with-redux (opens in a new tab) for an example of how to use this library as your Redux persistent layer (crucial for MV3). See MICE (opens in a new tab) for an experimental use case of this library integrated with WebRTC to pipe messages between browsers via an extension. Storage The base Storage API is designed to be easy to use. It is usable in every extension runtime such as background service workers, content scripts and extension pages. Get/set data without the need to JSON.stringify/parse.

Capabilities

Available capabilities

Tags

Tags

No tags filed yet.

Ways to use it

Ways to use it

No integrations filed yet.

Product features

Product features

Automatically copy data to localStorage

Customizing the storage area

React Hook API

Rendering AND persisting initial value

Rendering initial value WITHOUT persisting

Secure Storage

Storage

Storage API

Usage Examples

Watch and render a value

Watch (for state sync)

With a custom storage instance