Skip to content

Install

Use this if you use a bundler (Vite, Webpack, Rollup), WXT, Plasmo, or similar.

bash
npm install @moderok/sdk
js
import { Moderok } from "@moderok/sdk";

Types ship with the package.

Using WXT? You can use @wxt-dev/analytics with the Moderok provider instead of this package. See WXT.

Without a bundler

Copy moderok.js or moderok.min.js from the package’s dist/ folder (or from GitHub releases) into your extension.

js
import { Moderok } from "./moderok.min.js";

If the service worker uses import, set "type": "module" on the background entry in manifest.json as usual for your setup.

Next

Manifest & permissionsInitialization

Moderok: analytics for browser extensions