@featurevisor/vue
@featurevisor/vue
Vue functions for Featurevisor using a shared SDK instance. Vue is a peer dependency supplied by your application.
Installation
npm install @featurevisor/sdk @featurevisor/vue
Usage
Provide an instance when creating your app. This example bundles a CLI generated datafile:
Pass imported JSON as a string. TypeScript infers some JSON properties as broader types than the datafile type accepts.
import { createApp } from "vue";
import { createFeaturevisor } from "@featurevisor/sdk";
import { setupApp } from "@featurevisor/vue";
import App from "./App.vue";
import datafile from "./datafile.json";
const f = createFeaturevisor({ datafile: JSON.stringify(datafile) });
const app = createApp(App);
setupApp(app, f);
app.mount("#app");
Inside a component's setup, call useFlag("checkout", { userId: "123" }) from @featurevisor/vue. It returns a readonly ref that updates when the datafile, the context or sticky values change. See the guide for reactive context and other value types.
See the documentation.
License
MIT © Fahad Heylaal
Related Packages
Frontend helper for Laravel Pennant feature flags (with support for React and Vu...
Vue component which shows the flag of the country from which the language comes...
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 4.2.0 | ^3.0.0 | MIT | |
| 4.1.0 | ^3.0.0 | MIT | |
| 4.0.1 | ^3.0.0 | MIT | |
| 4.0.0 | ^3.0.0 | MIT | |
| 3.8.0 | ^3.0.0 | MIT | |
| 3.7.0 | ^3.0.0 | MIT | |
| 3.5.0 | ^3.0.0 | MIT | |
| 3.3.0 | ^3.0.0 | MIT | |
| 3.2.0 | ^3.0.0 | MIT | |
| 3.0.1 | ^3.5.38 | MIT | |
| 3.0.0 | ^3.5.38 | MIT | |
| 2.27.0 | ^3.3.4 | MIT | |
| 2.23.0 | ^3.3.4 | MIT | |
| 2.21.0 | ^3.3.4 | MIT | |
| 2.20.0 | ^3.3.4 | MIT | |
| 2.19.0 | ^3.3.4 | MIT | |
| 2.18.0 | ^3.3.4 | MIT | |
| 2.17.0 | ^3.3.4 | MIT | |
| 2.15.0 | ^3.3.4 | MIT | |
| 2.12.0 | ^3.3.4 | MIT | |
| 2.10.0 | ^3.3.4 | MIT | |
| 2.7.0 | ^3.3.4 | MIT | |
| 2.6.7 | ^3.3.4 | MIT | |
| 2.6.0 | ^3.3.4 | MIT | |
| 2.3.3 | ^3.3.4 | MIT | |
| 2.3.2 | ^3.3.4 | MIT | |
| 2.3.1 | ^3.3.4 | MIT | |
| 2.1.2 | ^3.3.4 | MIT | |
| 2.1.0 | ^3.3.4 | MIT | |
| 2.0.3 | ^3.3.4 | MIT |
Showing the latest 30 of 110. See every release on npm