Skip to main content

Philosophy

FlagKit treats feature flags as first-class TypeScript constructs rather than runtime configuration. This means your flags are:
  • Type-checked at compile time
  • Version-controlled with Git
  • Reviewed through pull requests
  • Deployed with your application code

Traditional vs. FlagKit Approach

Defining Flags

Flags are defined in flags.config.ts using the FlagKit schema:
flags.config.ts

Code Generation

Running flagkit generate produces:

Benefits

Type Safety

Catch errors at compile time, not runtime

Autocomplete

IDE knows all available flags and their types

Refactoring

Rename flags safely across your codebase

Documentation

Flags self-document with descriptions and types

Git Workflow

Because flags are code, they follow your normal Git workflow:

Version Control

Flag definitions are committed to Git, but generated code typically is not:
.gitignore
In CI/CD, run flagkit generate as part of your build process to ensure generated code is always fresh.

Schema Validation

FlagKit validates your flag definitions at generation time:
flags.config.ts

Next Steps

Local Evaluation

Learn how FlagKit evaluates flags without API calls