Socket
Book a DemoInstallSign in
Socket

storybook-addon-datalayer-watcher

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

storybook-addon-datalayer-watcher

Get GTM's dataLayer events in Storybook

latest
Source
npmnpm
Version
2.0.1
Version published
Weekly downloads
973
-58.63%
Maintainers
1
Weekly downloads
 
Created
Source

storybook-addon-datalayer-watcher

Installation

First, install the package.

npm install --save-dev storybook-addon-datalayer-watcher

Then, register it as an addon in .storybook/main.js.

// .storybook/main.ts

// Replace your-framework with the framework you are using (e.g., react-webpack5, vue3-vite)
import type { StorybookConfig } from '@storybook/your-framework';

const config: StorybookConfig = {
  // ...rest of config
  addons: [
    '@storybook/addon-essentials'
    'storybook-addon-datalayer-watcher', // 👈 register the addon here
  ],
};

export default config;

Usage

This addon allows you to debug GTM dataLayer events in Storybook.

If your component pushes to the dataLayer array (directly or using a library), you can interact with it in Storybook and see the GTM events it triggers.

Demo image

Storybook versions support

This addon supports all versions of Storybook starting 7.0

Please see the table bellow to see which addon version supports which Storybook versions.

VersionSupported Storybook versions
1.x>= 7.0, < 9.0
2.x>= 9.0

Credits

Thanks @cmarcchen for the idea

Keywords

storybook

FAQs

Package last updated on 07 Jun 2025

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