storybook-addon-datalayer-watcher
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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

Credits

Thanks @cmarcchen for the idea

Package Sidebar

Install

npm i storybook-addon-datalayer-watcher

Weekly Downloads

2,136

Version

1.0.2

License

MIT

Unpacked Size

19.2 kB

Total Files

12

Last publish

Collaborators

  • real_ouss