Chrome Extension Guide

Build type-safe Chrome extensions with the @theluckystrike/webext-* toolkit

@theluckystrike/webext-storage
Typed Chrome Storage

Features

  • Schema-based storage
  • Auto defaults
  • Type validation
  • Reactive watchers

Exports

defineSchema(), createStorage(), TypedStorage

const storage = createStorage({ schema, area: "local" });
await storage.set("theme", "light");
const theme = await storage.get("theme");
→ Storage Quickstart
@theluckystrike/webext-messaging
Typed Message Passing

Features

  • Promise-based API
  • Auto channel management
  • Async handlers

Exports

createMessenger<M>(), sendMessage, onMessage

const msg = createMessenger<Messages>();
const user = await msg.send("getUser", { id: 1 });
→ Messaging Quickstart
@theluckystrike/webext-permissions
Runtime Permission Helpers

Features

  • Human-readable descriptions
  • Batch operations
  • 50+ permissions

Exports

checkPermission, requestPermission, PERMISSION_DESCRIPTIONS

const result = await checkPermission("tabs");
console.log(result.description);
→ Permissions Quickstart

Install

npm install @theluckystrike/webext-storage @theluckystrike/webext-messaging @theluckystrike/webext-permissions

Tutorials

Storage Quickstart

Learn how to define schemas, create type-safe storage, and use reactive watchers.

Messaging Quickstart

Set up typed message passing between content scripts, background scripts, and popups.

Permissions Quickstart

Check, request, and manage Chrome permissions with human-readable descriptions.