Feature Flags in JavaScript
Installation
<script src="https://cdn.jsdelivr.net/npm/@ops-ai/[email protected]/dist/feature-flags-toggly.bundle.js"></script>$ npm install @ops-ai/feature-flags-toggly
$ cd node_modules/@ops-ai/feature-flags-toggly && npm run buildBasic Usage
Toggly.init({
appKey: '<YOUR_APP_KEY>',
environment: '<YOUR_APP_ENVIRONMENT>'
})
.then(function () {
// Now you can check if a feature (or more) is Enabled/Disabled
if (Toggly.isFeatureOn('SignUpButton')) {
// SignUpButton is ON
}
if (Toggly.isFeatureOff('DemoScreenshot')) {
// DemoScreenshot is OFF
}
});Last updated