0.1.1 • Published 3 years ago

@growthbook/dev v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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>
  );
}