Loading...
ConfigCat's simplicity is a double-edged sword — flags are easy to create but easy to forget. FlagShark connects to your ConfigCat dashboard via the Management API to find flags that have been serving a single value for weeks, then generates removal diffs for your TypeScript code.
FlagShark generates a PR that removes the dead branch and keeps only the winning code path
import * as configcat from 'configcat-js';
const client = configcat.getClient('YOUR_SDK_KEY');
async function SettingsPage({ userId }: { userId: string }) {
const user = new configcat.User(userId);
const showBetaSettings = await client.getValueAsync('beta_settings', false, user);
if (showBetaSettings) {
return <BetaSettingsPanel />;
}
return <SettingsPanel />;
}function SettingsPage() {
return <BetaSettingsPanel />;
}FlagShark uses AST parsing with ts-morph for precise SDK call detection to find every call to getValue(), getValueDetails(), getAllKeys()across your React, Next.js, Node.js codebase.
Each detected flag key is matched against your ConfigCat project to check rollout status, last evaluation date, and whether the flag is archived or still active.
For each stale flag, FlagShark creates a pull request that removes the SDK call, eliminates the dead code branch, and preserves the winning path. Every PR includes a before/after diff you can review.
ConfigCat's TypeScript SDK has both sync (`getValueSync`) and async (`getValueAsync`) methods — FlagShark detects both, but async calls wrapped in `Promise.all` for multiple flags require special handling to remove only the resolved flag.
Grep misses flags behind abstractions. AST-level scanning catches SDK calls that regex can't.
Every cleanup goes through code review. No surprises, no broken builds.
Only flags at 100% rollout for your configured threshold are suggested for removal.
New stale flags are detected automatically. Your codebase stays clean without manual audits.
getValue()getValueDetails()getAllKeys()Plus custom patterns you define in .flagshark.yaml
FlagShark traces imports from `configcat-js` and `configcat-js-ssr`, then finds every `getValueAsync`, `getValueSync`, and `getValueDetailsAsync` call. It reads your ConfigCat configuration to check each flag's current serving status.
Yes. FlagShark checks the ConfigCat dashboard to verify that a flag is serving 100% of users the same value. It warns you if a flag is still in a partial rollout before suggesting removal.
FlagShark detects `configcat.User` construction and custom attribute passing. When a flag with targeting rules is fully rolled out, it confirms all rules resolve to the same value before generating the cleanup diff.
Connect your repo, see stale flags in minutes, and get cleanup PRs automatically.
Free tier available • No credit card required • 5-minute setup
Find and remove stale ConfigCat flags from Django, FastAPI, and Flask Python applications.
Find and safely remove stale ConfigCat feature flags from Spring Boot and Java enterprise applications.
Use Roslyn analyzers and FlagShark to find and remove stale ConfigCat flags from ASP.NET Core and .NET services.
A hands-on guide to finding and safely removing stale LaunchDarkly feature flags from TypeScript and React codebases.
Detect and remove abandoned Split.io treatments from your TypeScript frontend and Node.js backend.
Find and remove stale Unleash feature toggles from React, Next.js, and Node.js TypeScript projects.
Detect and remove abandoned PostHog feature flags from React and Next.js TypeScript applications.
Find and safely remove stale Flagsmith flags from React and Node.js TypeScript codebases.