Lightweight analytics and error tracking for Manifest V3 browser extensions. Zero runtime dependencies, built for service workers and every extension context.
| Constraint | Detail |
|---|---|
| Size | About 5 kB gzipped (minified) |
| Permissions | "storage" only — no host_permissions required |
| Environments | Service worker, popup, options, side panel, content scripts |
| Error tracking | On by default for uncaught errors and unhandled rejections |
npm install @moderok/sdkimport { Moderok } from "@moderok/sdk";
Moderok.init({ appKey: "mk_your_app_key" });
Moderok.track("feature_used", { theme: "dark" });Call init() at top level in your background service worker — synchronously, not after await or inside .then(). Make sure "storage" is listed in your manifest.json permissions.
A standalone moderok.min.js is also available under dist/ via jsDelivr for extensions without a bundler.
Full documentation at docs.moderok.dev — manifest setup, API reference, error tracking, uninstall tracking, and troubleshooting.
MIT — see LICENSE.