Skip to content

jhoermann/flagsmith-vue

Repository files navigation

flagsmith-vue

An (unofficial) Flagsmith Vue.js integration that uses Vue Composition API to dynamically update feature flags and traits in components. Compatible with Vue.js versions 2.7 and 3.

npm GitHub GitHub tests workflow Codacy Code Quality Codacy Coverage

Installation

npm install flagsmith-vue flagsmith

Usage

Initialize the integration with the useFlagsmith helper in your root/parent component:

import { useFlagsmith } from 'flagsmith-vue'

useFlagsmith(options)

For options see Flagsmith initialization options.

Then you can access the flags, traits, loading status and the Flagsmith instance itself inside your child components:

import { useFlags, useTraits, useFlagsmithLoading } from 'flagsmith-vue'

const flags = useFlags(['flag1', 'flag2', ...])
const traits = useTraits(['trait1', 'trait2', ...])
const flagsmithLoading = useFlagsmithLoading()
const { setTraits } = useFlagsmithInstance()

License

Unless otherwise noted, all source code is licensed under the MIT License.
Copyright (c) 2025 Jochen Hörmann

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy