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

@amplitude/storybook-addon-amplitude

Package Overview
Dependencies
Maintainers
19
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amplitude/storybook-addon-amplitude

A storybook addon to capture events in Amplitude

0.0.4-canary.5.a11f85a.0
Source
npm
Version published
Weekly downloads
8.4K
-6.51%
Maintainers
19
Weekly downloads
 
Created
Source

storybook-addon-amplitude

A storybook addon to capture events in Amplitude.

What does it do?

When configured correctly, this storybook addon will send events to your Amplitude instance in two cases:

  • If a user navigates from one story to another
  • If a user modifies story args

Usage Guidelines

Install:

yarn add @amplitude/storybook-addon-amplitude --dev

in storybook/main.js

module.exports: {
  addons: [
    'storybook-addon-amplitude/preset',
  ]
}

Then, set your Amplitude API keys in ./storybook/manager.js

window.AMPLITUDE_DEV_API_KEY = '<amplitude-dev-api-key>';
window.AMPLITUDE_PROD_API_KEY = '<amplitude-prod-api-key>';

Event Taxonomy

This storybook addon emits events to Amplitude on two different occasions, when a user switches to a new page and when a user changes a story's args.

When a user switches to a new page, this addon emits an event that looks like this:

{
  event_type: "viewed documentation", 
  event_properties: {
    category: 'variants', 
    page: "secondarybuttongroup"
  }
}

Tracking this event in this way allows you to build charts in Amplitude to show:

a) How many people have viewed your Storybook instance over time b) What category of pages people are viewing most frequently c) What pages people are viewing most frequently

When a user changes a story's args, this addon emits an event that looks like this:

{
  event_type: "updated story args", 
  event_properties: {
    category: 'variants', 
    page: "secondarybuttongroup"
  }
}

a) How often people use the story args functionality b) In which category of pages people update the story args most frequently c) On which pages people update the story args most frequently

Keywords

amplitude

FAQs

Package last updated on 17 May 2022

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