Registry / web-framework / plasmo

plasmo

JSON →
library0.90.5jsnpmunverified

The Plasmo Framework is a comprehensive Software Development Kit (SDK) designed for building browser extensions with a focus on developer experience, akin to Next.js for web applications. It abstracts away complex configuration, offering first-class support for React and TypeScript. Key features include declarative development, Content Scripts UI, Tab Pages, live-reloading with React HMR, environment file support, and built-in Storage and Messaging APIs. The framework simplifies targeting multiple browsers and manifest versions, and supports automated deployment via Browser Publish Protocol (BPP). It is currently in a stable state with version `0.90.5`, maintaining a rapid release cadence with frequent minor updates and patch fixes. Its differentiators lie in its 'batteries-included' approach, robust tooling, and focus on streamlining the extension development workflow.

npm install plasmo
INSTALL
IMPORT
SIG · PLASMO
P
plasmo
web-frameworkjavascriptv0.90.5
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

defineManifest
import { defineManifest } from 'plasmo'
Used in `manifest.ts` to programmatically define and configure the browser extension's manifest file.
PlasmoCSUI
import type { PlasmoCSUI } from 'plasmo'
Type definition for Content Script UI components, typically imported for type checking when creating React/TSX content script entrypoints.
PlasmoExtensionManifest
import type { PlasmoExtensionManifest } from 'plasmo'
Type definition representing the structure of a Plasmo browser extension manifest, useful for ensuring type safety in `manifest.ts`.

Initializes a new Plasmo extension project, installs dependencies, and demonstrates how to start the development server and build for production.

npx plasmo init my-extension cd my-extension pnpm install # Or npm install / yarn install # Start development server with live-reloading plasmo dev # Build for production, e.g., for Chrome, Manifest V3, and create a zip file plasmo build --target=chrome-mv3 --zip
plasmo --version
Debug
Known issues
breakingPlasmo versions prior to `v0.90.1` may not fully support React 19. Using newer React versions with older Plasmo releases could lead to build or runtime inconsistencies.
fix
Upgrade Plasmo to `v0.90.1` or later to ensure compatibility with React 19. Also, confirm `react` and `react-dom` versions are aligned with the Plasmo update.
affects: <0.90.1
gotchaContent Security Policy (CSP) restrictions and `TrustedTypePolicy` creation could cause runtime errors, particularly affecting loading indicators in browser extensions built with Plasmo versions before `v0.90.1`.
fix
Upgrade Plasmo to `v0.90.1` or later, as this release includes specific fixes for CSP and TrustedTypePolicy related issues.
affects: <0.90.1
gotchaIn Plasmo versions before `v0.89.3`, the framework's internal new version check mechanism could inadvertently block or significantly delay `plasmo dev` and `plasmo build` commands, hindering the development workflow.
fix
Upgrade Plasmo to `v0.89.3` or later to resolve the blocking behavior associated with the version check.
affects: <0.89.3
gotchaUpdates to native dependencies like `sharp` (e.g., in `v0.90.2`) can sometimes introduce platform-specific build failures. If you encounter build issues after a Plasmo update, especially on different operating systems, native module conflicts might be the cause.
fix
Perform a clean install of node modules by deleting `node_modules` and your lock file (`pnpm-lock.yaml`, `package-lock.json`, or `yarn.lock`), then reinstalling dependencies with `pnpm install` (recommended) or `npm install`.
affects: >=0.90.2
Errors
Common errors & fixes
Error: ENOENT: no such file or directory, stat '<path>'
A file system operation, often involving internal asset handling, failed because a required file or directory was not found.
fix
Upgrade Plasmo to `v0.90.5` or later, which includes improved error handling for ENOENT. Ensure all files referenced in your project exist at the correct paths.
TypeError: `defineManifest` must return an object (Got type string)
The `manifest.ts` file is not correctly exporting a manifest object. This typically occurs if `defineManifest` is not used or if its return value is not a plain object.
fix
Ensure your `manifest.ts` explicitly uses `export default defineManifest({ ... })` and that the object passed to `defineManifest` is well-formed.
Refused to create a Trusted Type policy because the name 'plasmo' is not a valid policy name. (Browser Console Error)
A Content Security Policy (CSP) restriction is preventing Plasmo's internal loading indicator from creating a necessary TrustedTypePolicy in the browser environment.
fix
Upgrade Plasmo to `v0.90.1` or later, as this version includes specific bug fixes to address TrustedTypePolicy CSP compatibility issues. Review your extension's CSP if the issue persists on older Plasmo versions.
Upgrade
Version history
0.90.5latest on npm
Audit
Dependencies
pnpmoptionalStrongly recommended package manager for consistent dependency management and faster installations within Plasmo projects.
Agent activity
2 hits · last 30 days
node
2
Resources
plasmo — npm install plasmo · libregistry