New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

storybook-addon-matomo

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

storybook-addon-matomo

Storybook addon for Matomo Analytics

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
152
decreased by-15.08%
Maintainers
1
Weekly downloads
 
Created
Source

Storybook Addon Matomo

Storybook Addon Matomo can be used to support Matomo Analytics in Storybook.

Getting Started

Install:

yarn add storybook-addon-matomo

within .storybook/main.js:

module.exports = {
  addons: ['storybook-addon-matomo']
}

Then, set an environment variable in .storybook/manager.js:

window.STORYBOOK_MATOMO_OPTIONS = {
  urlBase: 'https://LINK.TO.DOMAIN', // 👈 required
  siteId: 3, // 👈 required
  userId: 'UID76903202', // optional, default value: `undefined`.
  trackerUrl: 'https://LINK.TO.DOMAIN/tracking.php', // optional, default value: `${urlBase}matomo.php`
  srcUrl: 'https://LINK.TO.DOMAIN/tracking.js', // optional, default value: `${urlBase}matomo.js`
  disabled: false, // optional, false by default. Makes all tracking calls no-ops if set to true.
  heartBeat: { // optional, enabled by default
    active: true, // optional, default value: true
    seconds: 10 // optional, default value: `15
  },
  linkTracking: false, // optional, default value: true
  configurations: { // optional, default value: {}
    // any valid matomo configuration, all below are optional
    disableCookies: true,
    setSecureCookie: true,
    setRequestMethod: 'POST'
  }
};

Note: This integration is based on @datapunt/matomo-tracker-js, so all configuration options are available.

If you would like to store your urlBase, siteId, etc. in an environment variable so it is not available in your repo, simply add .env file to the root of your project or set environment variables in your CI and reference that in manager.js

.env:

STORYBOOK_MATOMO_URL = https://LINK.TO.DOMAIN
STORYBOOK_MATOMO_SITE_ID = 3

storybook/manager.js:

window.STORYBOOK_MATOMO_OPTIONS = {
  urlBase: process.env.STORYBOOK_MATOMO_URL,
  siteId: process.env.STORYBOOK_MATOMO_SITE_ID,
  // ...
}

Keywords

FAQs

Package last updated on 17 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc