You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This app uses environment-based flags to toggle frontend features safely. We use a **fail-closed** approach: if a variable is not exactly `"true"`, the feature is treated as disabled.
4
+
5
+
> [!IMPORTANT]
6
+
> Vite injects `import.meta.env` values at build/dev-server startup time.
7
+
> Restart the dev server after changing `.env` values so flag updates take effect.
8
+
9
+
## Registered Flags
10
+
11
+
| Key | Env Var | Notes |
12
+
| :--- | :--- | :--- |
13
+
|`ANALYTICS_PAGE`|`VITE_FF_ANALYTICS_PAGE`| Gates the analytics route until rollout is approved. |
14
+
15
+
## How to Add a Flag
16
+
17
+
1. Register the key in `FLAG_KEYS` in `src/context/FeatureFlagContext.tsx`.
18
+
2. Add the env variable to `.env.example` (`VITE_FF_<FLAG_KEY>`).
19
+
3. Use `useFeatureFlag` (evaluation utility) or `<FeatureGate>` where needed.
20
+
21
+
## Usage Patterns
22
+
23
+
### 1) Component wrapper (preferred for full sections/routes)
0 commit comments