Installation
Add the@growthbook/growthbook package to your project.
Create a Provider
Use Vue’sapp.provide method to make GrowthBook available to your components.
In your app’s entry file, usually ./src/main.ts, add the following code:
Inject GrowthBook into a Component
Next, import thegbKey and inject GrowthBook into your component. Below, we use the isOn helper to check if a feature flag is on. See additional helpers in the JS SDK docs.
- Composition API
- Options API
component.vue
Use the Feature Flag in a Template
Combine Vue’sv-if directive with the showBanner variable to conditionally render content based on the feature flag value.
component.vue

