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) {
} else {
}
});
Licensing
MIT