@growthbook/dev
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

GrowthBook SDK Dev Mode

Adds a widget to your site that helps during development of GrowthBook A/B tests.

Currently only supports client-side SDKs (javascript and react). Server-side support is coming soon!

Only for use on development/staging builds. Do not use in production!!!

Dev Mode Variation Switcher

Usage

To use, simply add a script tag to your development HTML:

<script
  async
  src="https://unpkg.com/@growthbook/dev/dist/bundles/index.min.js"
></script>

OR if you are using the GrowthBook React SDK, you can render the dev mode component directly if you prefer:

import { GrowthBook, GrowthBookProvider } from "@growthbook/growthbook-react";
import { GrowthBookDev } from "@growthbook/dev";

const growthbook = new GrowthBook({
  user: { id: "1" },
});

export default function MyApp() {
  return (
    <GrowthBookProvider growthbook={growthbook}>
      <App />
      {process.env.NODE_ENV !== "production" && <GrowthBookDev />}
    </GrowthBookProvider>
  );
}

Readme

Keywords

none

Package Sidebar

Install

npm i @growthbook/dev

Weekly Downloads

1

Version

0.1.1

License

MIT

Unpacked Size

1.22 MB

Total Files

29

Last publish

Collaborators

  • jdorn