Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Add a bugherd feedback button to the storybook UI

License

Notifications You must be signed in to change notification settings

etchteam/storybook-addon-bugherd

Repository files navigation

Storybook Addon Bugherd

A Storybook Addon to add a Bugherd feedback button in Storybook.

React Storybook Screenshot

Installation

npm install @etchteam/storybook-addon-bugherd --save-dev

Configuration

Create a file called main.js in your .storybook config folder.

Add the following content to it:

module.exports = {
  addons: ['@etchteam/storybook-addon-bugherd/register']
}

Next, add a file called preview-head.html in your storybook config folder and add this bugherd script to it.

<script>
  var BugHerdConfig = {
    feedback: {
      hide: true,
    }
  };
</script>
<script type="text/javascript" src="https://www.bugherd.com/sidebarv2.js?apikey=<BUGHERD_API_KEY>" async="true"></script>

Finally, in preview.js or config.js (depending on how you have set up storybook) in your storybook folder, you'll need to add a global decorator.

import { addDecorator } from '@storybook/react';
import withBugherd from '@etchteam/storybook-addon-bugherd';

addDecorator(withBugherd);

You'll get a bugherd feedback button for anonymous users injected in the top toolbar.

Made with ☕ at Etch

About

Add a bugherd feedback button to the storybook UI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published