npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@razzeee/docusaurus-plugin-matomo

v0.2.0

Published

Docusaurus Plugin to work with matomo analytics

Readme

@razzeee/docusaurus-plugin-matomo

Docusaurus Plugin to work with matomo analytics

Requires Docusaurus 3.10.2+ and Node.js 20+. Supports Docusaurus Faster.

See the release guide for dependency maintenance and publishing.

Installation

pnpm add -D @razzeee/docusaurus-plugin-matomo

Usage

module.exports = {
  plugins: [
    [
      require.resolve("@razzeee/docusaurus-plugin-matomo"),
      {
        siteId: "TEST_SITE_ID",
        matomoUrl: "TEST_MATOMO_URL",
        siteUrl: "TEST_SITE_URL",
        // ... more options can be provided please see the options below
      },
    ],
  ],
};

Site search

Enable siteSearch in the plugin options to send searches to Matomo's Site Search reports:

{
  siteId: "40",
  matomoUrl: "https://analytics.example.org",
  siteUrl: "https://docs.example.org",
  siteSearch: true,
}

Search tracking is disabled by default. When enabled:

  • Live search queries are recorded after 500 ms without input; Enter records immediately. Empty queries and intermediate IME composition are ignored.
  • The default selector matches .navbar__search-input, .DocSearch-Input and input[type="search"], including dynamically mounted search dialogs. It works with the search input markup used by Docusaurus DocSearch and @easyops-cn/docusaurus-search-local without swizzling their components.
  • Visits to <baseUrl>search?q=… record a search instead of a page view, as recommended by Matomo. Both /search and /search/ are recognized.
  • Consecutive identical queries on the same page are deduplicated, including Enter followed by navigation to the results page. Clearing the field or navigating to an ordinary page allows the same query to be recorded again.
  • Search commands use the same Matomo queue and consent/DNT settings as page views. The plugin does not bypass consent or invent a result count.

For a custom search UI, override the selector, delay or results URL:

siteSearch: {
  inputSelector: "#documentation-search",
  debounceMs: 750,
  path: "/docs/find", // Full pathname, including any site baseUrl
  queryParameter: "term",
}

This measures live search queries, not result clicks or successful searches. Result counts and categories require integration with your search provider. If you already send trackSiteSearch commands yourself, leave siteSearch disabled to avoid counting the same searches twice.

Migrating from the original plugin

Replace @gabrielcsapo/docusaurus-plugin-matomo with @razzeee/docusaurus-plugin-matomo in your dependencies and plugin configuration. Existing Matomo settings remain supported. The malformed no-JavaScript fallback has been removed; tracking requires JavaScript. See CHANGELOG.md for the changes in 0.2.0.

Options

| Option | Explanation | | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | siteId | Your Matomo site ID configured in your Matomo installation. | | matomoUrl | The url of your Matomo installation. | | siteUrl | Legacy required option, retained for configuration compatibility. The broken noscript fallback has been removed; this value is no longer used for tracking. | | matomoPhpScript | (optional) The name of your Matomo PHP script. Defaults to piwik.php | | matomoJsScript | (optional) The name of your Matomo JS script. Defaults to piwik.js | | requireConsent | (optional) If true, tracking will be disabled until you call window._paq.push(['setConsentGiven']);. | | requireCookieConsent | (optional) If true, no cookies will be stored or used until you call window._paq.push(['setCookieConsentGiven']);. | | disableCookies | (optional) If true, no cookie will be used by Matomo. | | cookieDomain | (optional) Specify cookie domain. | | localScript | (optional) If set, load local piwik.js script from the given path, instead of loading it from your matomoUrl. | | respectDnt | (optional) If false, will load all scripts without respecting user preference to Do Not Track on browsers. Defaults to true. | | dev | (optional) Activate dev mode by setting to true. Will load all scripts despite not running in production environment. Ignores your local browser's DNT header too. Outputs some information in console about what it is doing. Useful for local testing but careful: all hits will be send like in production. | | enableJSErrorTracking | (optional) Enable basic JavaScript error tracking and reporting in Matomo by setting to true. |