@webcc-dev/unleash

Nuxt module to use Unleash feature flags
3,192
Install
npm install @webcc-dev/unleash
Latest Version:3.0.1
Vue:3
License:MIT
Last Updated:Sep 25, 2026
Links: npm
Maintainer: cscheel

Webcc Unleash

Nuxt module to use Unleash feature flags

Installation

  1. Install @webcc-dev/unleash dependency to your project:
pnpm add -D @webcc-dev/unleash
  1. Add @webcc-dev/unleash to your nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@webcc-dev/unleash'],

  webccUnleash: {
    // when config plugin should wait app plugins, e.g. `pluginDeps: ['init-plugin']`
    pluginDeps: []
  },

  // Values from .env file are automatically inserted into the corresponding fields in the runtimeConfig.
  runtimeConfig: {
    unleash: {
      apiKey: '',
    },
    public: {
      unleash: {
        url: '',
        appName: '',
        environment: '',
        featureBaseUrl:
          'https://app.unleash-hosted.com/KEY_ID/projects/PROJ/features/',
      },
    },
  },
})
  1. Create unleash.config.ts in your root directory and implement getContext() function
import type { H3Event } from 'h3'
import type { UnleashAppConfig } from '#build/types/unleash'

export default {
  getContext(req: H3Event) {
    return {
      userId: 'some-user-id',
      domain: undefined,
      remoteAddress: '123.1.2.3',
      properties: { language: 'EN', fullDomain: 'undefined', partnerId: undefined },
    }
  },
} satisfies UnleashAppConfig

That's it! You can now use Webcc Unleash in your Nuxt app ✨

Usage

You can use the useFlag() composable to get the status of your feature flag

const isEnabled = useFlag('your-feature-flag')

Other composables, mostly for dev-only usage:

// useFeature
const feature = useFeature('your-feature-flag')
const {
  key, // unique key
  title,
  url,
  isEnabled,
  variant,
  variants,
  markers, // keywords `[keyword]` in feature description
  toggle,
} = feature

const features = useFeatures({
  all: true, // when true, then pick also disabled features
})

Contribution

# Install dependencies
pnpm install

# Generate type stubs
pnpm dev:prepare

# Develop with the playground
pnpm dev

# Build the playground
pnpm dev:build

Releases run via the Release GitHub Actions workflow (Actions → Release → Run workflow → choose patch/minor/major).

Related Packages

@webcc-dev/svg-icons

Webcc nuxt layers

11,657
@webcc-dev/tailwindcss

Tailwind CSS module for Nuxt

11,546
@webcc-dev/components

Webcc nuxt layers

11,532
@webcc-dev/toaster

toaster nuxt module

11,031
@webcc-dev/floating-ui

Nuxt floating ui module alternative

10,737

Version History

Version Released License
3.0.1 MIT
3.0.0 MIT