flagcontrol
v0.2.4
Published
The CLI tool for [FlagControl](https://flagcontrol.com) to generate TypeScript definitions for your feature flags.
Downloads
37
Readme
flagcontrol
The CLI tool for FlagControl to generate TypeScript definitions for your feature flags.
Installation
npm install -D flagcontrolUsage
Run the generator to fetch your latest flag definitions and generate TypeScript types (RegisteredFlags).
npx flagcontrol generateThis will default to generating a file at ./src/flagcontrol.d.ts.
Options
| Option | Alias | Description | Default |
|--------|-------|-------------|---------|
| --output | -o | Path to the output declaration file | ./src/flagcontrol.d.ts |
| --key | | Your SDK Key (can also set via env) | process.env.FLAGCONTROL_SDK_KEY |
| --apiUrl | | Base URL for the FlagControl API | https://api.flagcontrol.com |
Examples
Specify output file:
npx flagcontrol generate -o ./src/types/feature-flags.d.tsPass SDK key inline:
npx flagcontrol generate --key YOUR_SDK_KEYConfiguration
The recommended way to configure the generator is via environment variables, especially for CI/CD pipelines.
FLAGCONTROL_SDK_KEY: Your SDK Key.FLAGCONTROL_API_URL: (Optional) Base API URL if using a self-hosted instance.
Related Packages
| Package | Description |
|---------|-------------|
| @flagcontrol/core | Core SDK logic |
| @flagcontrol/react | React SDK with hooks |
| @flagcontrol/node | Node.js SDK |
