Skip to main content
Start faster by scaffolding extensions from official templates instead of building folder structure and configuration from scratch.

Template capabilities

  • Ready project structure: Start with a working manifest, scripts, and source layout.
  • Stack-specific setup: Choose templates by framework and runtime needs.
  • Faster onboarding: Move from idea to runnable extension in minutes.
  • Consistent defaults: Reduce setup drift across projects and team members.

Quick usage

Replace <slug> with the template you want to start from.

Available templates

Each template scaffolds a minimal, runnable extension with a working manifest.json. Expand one for what it gives you, the exact command, and a walkthrough.
A clean ES modules baseline with no compile step. The template wires up manifest.json, a sidebar panel, a background script, and a content script entry point, so you can run extension dev and start iterating immediately. Choose it when you want the smallest possible setup.
Browse the full source on GitHub: extension-js/examples/javascript
Static types across the sidebar panel, content, and background scripts, with chrome and browser API typings configured. Catch manifest, messaging, and permission bugs at compile time instead of in the browser console. This is the default when you omit --template.
Browse the full source on GitHub: extension-js/examples/typescript
Compile-time UI with single-file .svelte components and a minimal runtime footprint. The template scaffolds a sidebar panel and a content script, plus the build configuration needed for HMR-friendly Svelte authoring inside an extension context.
Browse the full source on GitHub: extension-js/examples/svelte
A progressive setup with .vue single-file components, scaffolded as a sidebar panel plus a content script. The template handles SFC compilation and reload behavior, so you can focus on UI.
Browse the full source on GitHub: extension-js/examples/vue
The same component model as React with a 3kB runtime, configured with the standard preact/compat aliasing so most React libraries keep working. A good fit when bundle size matters, especially for content scripts injected into other people’s pages.
Browse the full source on GitHub: extension-js/examples/preact
A component-based UI baseline with full Manifest V3 support. The sidebar panel and content script ship as React entry points with hot module replacement wired up. Edit a component and see it update without reloading the extension by hand.
Browse the full source on GitHub: extension-js/examples/react

How it works

When you run create --template=<slug>, Extension.js fetches the selected template, scaffolds the project files, and optionally installs dependencies. Only the javascript template ships inside the CLI, so it scaffolds offline with no network call. The default when you omit --template is typescript, which downloads like every other name. When that download fails, create falls back to the bundled javascript template and names the network error. The catalog holds 6 groups and roughly 50 templates: starters, sidebar, content scripts, new tab, toolbar action, and special folders. Run extension create --help to see every name. A name outside the catalog fails with E_TEMPLATE_NOT_FOUND and creates nothing. A failed download is reported as a download error instead, so a network problem never reads like a typo.

Reproducible scaffolds

The template corpus is pinned to an immutable commit of the examples repository. Two scaffolds of the same template always produce the same files, and a shipped CLI never tracks a moving branch. You can point at a different corpus:
EXTENSION_CREATE_TEMPLATE_REF accepts a branch, a tag, or a commit SHA. Setting it to main restores the floating branch behavior.

Scaffold from a URL

--template also accepts a GitHub URL or a ZIP URL in place of a catalog name:
From 4.1.19, template URLs and EXTENSION_CREATE_TEMPLATE_URL must use https://. create refuses http:// unless you set EXTENSION_ALLOW_HTTP_TEMPLATE=true.

More templates

Find official template sources in the examples repository: Template folder names map directly to --template=<slug>.

Best practices

  • Use templates to scaffold your project quickly.
  • Start with a template that matches a technology stack you already know.
  • Choose the browser extension context that best fits your project requirements.

Next steps