@pbs/vanna

0.5.0 • Public • Published

Vanna Javascript (Browser) Client

Introduction

Vanna is an internal feature flagging service used at PBS. It helps deliver new features to users quickly and safely. This is an example client implementation for browser based Javascript.

To learn more about the rationale behind using feature flags, read these articles:

Install

The recommended way to install vanna is through npm.

npm install @pbs/vanna

Setup

After installing vanna, you can import it with your Javascript bundler of choice and setup the client.

import { VannaClient } from "@pbs/vanna";

const client = VannaClient({
  uri: "https://vanna.example.com/project",
  userSegment: "beta-tester",
  fallbacks: {
    "your-feature-slug": false
  }
});

client.on("ready", () => {
  const isFeatureEnabled = client.variation("your-feature-slug", {
    fallback: false
  });

  if (isFeatureEnabled) {
    // Do something if feature is enabled
  } else {
    // Do another thing if feature is disabled
  }
});

Licensing

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @pbs/vanna

Weekly Downloads

0

Version

0.5.0

License

MIT

Unpacked Size

12.7 kB

Total Files

11

Last publish

Collaborators

  • wamberg
  • asberk
  • apirjol
  • pbs_jamoore