Supported Languages
Complete list of programming languages and feature flag SDKs that FlagShark supports.
FlagShark supports detection of feature flags across 13 programming languages and all major feature flag providers. This page lists supported languages, file extensions, and SDK patterns.
Language Support Overview
| Language | Extensions | Detection Engine | Built-in Providers |
|---|---|---|---|
| TypeScript | .ts, .tsx, .js, .jsx, .mjs, .cjs | AST (tree-sitter) | All 17 — see below |
| JavaScript | .js, .jsx, .mjs, .cjs | AST (tree-sitter) | All 17 — same as TypeScript |
| Go | .go | AST (tree-sitter) | All 13 — see below |
| Python | .py, .pyw, .pyx, .pyi | AST (tree-sitter) | All 13 — see below |
| Rust | .rs | Regex | LaunchDarkly, Unleash, Flagsmith, ConfigCat, GrowthBook, Eppo |
| C# | .cs, .csx | Regex | LaunchDarkly, Unleash, Split.io, Optimizely, Flagsmith, ConfigCat, Statsig, GrowthBook, DevCycle, Eppo, PostHog, Microsoft Feature Management |
| Java | .java | Regex | LaunchDarkly, Unleash, Split.io, Flipt, Optimizely, Flagsmith, ConfigCat, Statsig, GrowthBook, DevCycle, Eppo, PostHog |
| Kotlin | .kt, .kts | Regex | LaunchDarkly, Unleash, Split.io, Flipt, Optimizely, ConfigCat, Statsig, GrowthBook, DevCycle, Eppo, PostHog |
| Ruby | .rb, .rake, .gemspec | Regex | LaunchDarkly, Unleash, Split.io, Flipper, Optimizely, Flagsmith, ConfigCat, Statsig, GrowthBook, DevCycle, Eppo, PostHog |
| PHP | .php, .phtml, .php3, .php4, .php5, .phps | Regex | LaunchDarkly, Unleash, Split.io, Flagsmith, ConfigCat, Statsig, GrowthBook, PostHog, Laravel Pennant |
| Swift | .swift | Regex | LaunchDarkly, Unleash, Split.io, Optimizely, Flagsmith, ConfigCat, Statsig, GrowthBook, DevCycle, Eppo, PostHog |
| C++ | .cpp, .cc, .cxx, .c++, .hpp, .hh, .hxx, .h++, .h, .c | Regex | LaunchDarkly (Server + Client), Unleash, ConfigCat, GrowthBook |
| Objective-C | .m, .mm, .h | Regex | LaunchDarkly, Unleash, Split.io, Optimizely, Flagsmith, ConfigCat, PostHog |
Detection engines:
- AST (tree-sitter): Structural parse of the syntax tree — survives minification, aliased imports, and unusual whitespace. Enabled by default for TypeScript, JavaScript, Go, and Python; can be overridden per language via
enginein.flagshark.yml. - Regex: Pattern matching on source text. Same provider coverage; slightly more sensitive to unusual formatting.
All languages also detect custom providers configured in .flagshark.yml.
TypeScript & JavaScript
Both languages use the same provider set (JavaScript re-uses the TypeScript detector). The detector reports the language separately based on file extension.
File Extensions
.ts,.tsx(TypeScript).js,.jsx(JavaScript).mjs,.cjs(ES/CommonJS modules)
Built-in Providers (17)
LaunchDarkly (JS client, Node server, React SDK, legacy Node), Unleash, Split.io, React Feature Flags, Optimizely, Flagsmith, ConfigCat, Flipt, Statsig, GrowthBook, DevCycle, Eppo, PostHog (browser + Node)
LaunchDarkly SDK
// React SDK
import { useFlags, useLDClient } from '@launchdarkly/react-client-sdk';
function MyComponent() {
// Object destructuring - detected
const { enableDarkMode, showBetaFeatures } = useFlags();
// Client instance - detected
const ldClient = useLDClient();
const value = ldClient?.variation('flag-key', false);
}
// Node.js SDK
import LaunchDarkly from '@launchdarkly/node-server-sdk';
const client = LaunchDarkly.init('sdk-key');
// All variation methods detected
client.variation('flag-key', context, false);
client.boolVariation('flag-key', context, false);
client.stringVariation('flag-key', context, '');
client.intVariation('flag-key', context, 0);
client.jsonVariation('flag-key', context, {});
Unleash SDK
// React SDK
import { useFlag, useVariant } from '@unleash/proxy-client-react';
function MyComponent() {
const enabled = useFlag('feature-flag');
const variant = useVariant('feature-flag');
}
// Node.js SDK
import { Unleash } from 'unleash-client';
const unleash = new Unleash({ /* config */ });
unleash.isEnabled('feature-flag');
unleash.getVariant('feature-flag');
Split SDK
// Browser SDK
import { SplitFactory } from '@splitsoftware/splitio';
const factory = SplitFactory({ /* config */ });
const client = factory.client();
client.getTreatment(userKey, 'feature-flag');
client.getTreatments(['flag-1', 'flag-2']);
Go
File Extensions
.go
Built-in Providers (13)
LaunchDarkly, ZeroFlag, Unleash, Flipt, Split.io, Optimizely, Flagsmith, ConfigCat, Statsig, GrowthBook, DevCycle, Eppo, PostHog
LaunchDarkly SDK
import (
ld "github.com/launchdarkly/go-server-sdk/v7"
)
func main() {
client, _ := ld.MakeClient("sdk-key", 5*time.Second)
// All variation methods detected
enabled, _ := client.BoolVariation("flag-key", context, false)
str, _ := client.StringVariation("flag-key", context, "default")
num, _ := client.IntVariation("flag-key", context, 0)
float, _ := client.Float64Variation("flag-key", context, 0.0)
json, _ := client.JSONVariation("flag-key", context, ldvalue.Null())
}
Unleash SDK
import "github.com/Unleash/unleash-client-go/v4"
func main() {
unleash.Initialize(/* config */)
enabled := unleash.IsEnabled("feature-flag")
variant := unleash.GetVariant("feature-flag")
}
Python
File Extensions
.py,.pyw,.pyx,.pyi
Built-in Providers (13)
LaunchDarkly, Unleash, Split.io, Flipt, Django Feature Flags, Optimizely, Flagsmith, ConfigCat, Statsig, GrowthBook, DevCycle, Eppo, PostHog
LaunchDarkly SDK
import ldclient
from ldclient import Context
ldclient.set_config(Config("sdk-key"))
client = ldclient.get()
# All variation methods detected
enabled = client.variation("flag-key", context, False)
enabled = client.bool_variation("flag-key", context, False)
Unleash SDK
from UnleashClient import UnleashClient
client = UnleashClient(url="...", app_name="...")
client.initialize_client()
enabled = client.is_enabled("feature-flag")
variant = client.get_variant("feature-flag")
Rust
Detection engine: Regex
File Extensions
.rs
Built-in Providers (6)
LaunchDarkly, Unleash, Flagsmith, ConfigCat, GrowthBook, Eppo
LaunchDarkly SDK
use launchdarkly_server_sdk::{Client, ConfigBuilder};
fn main() {
let client = Client::build(ConfigBuilder::new("sdk-key")).unwrap();
// Variation methods detected
let enabled = client.bool_variation(&context, "flag-key", false);
let value = client.string_variation(&context, "flag-key", "default");
let value = client.int_variation(&context, "flag-key", 0);
let value = client.float_variation(&context, "flag-key", 0.0);
}
C#
Detection engine: Regex
File Extensions
.cs,.csx
Built-in Providers (12)
LaunchDarkly, Unleash, Split.io, Optimizely, Flagsmith, ConfigCat, Statsig, GrowthBook, DevCycle, Eppo, PostHog, Microsoft Feature Management
LaunchDarkly SDK
using LaunchDarkly.Sdk;
using LaunchDarkly.Sdk.Server;
var client = new LdClient("sdk-key");
// All variation methods detected
bool enabled = client.BoolVariation("flag-key", context, false);
string value = client.StringVariation("flag-key", context, "default");
int value = client.IntVariation("flag-key", context, 0);
double value = client.DoubleVariation("flag-key", context, 0.0);
LdValue value = client.JsonVariation("flag-key", context, LdValue.Null);
Unleash SDK
using Unleash;
var unleash = new DefaultUnleash(config);
bool enabled = unleash.IsEnabled("feature-flag");
Variant variant = unleash.GetVariant("feature-flag");
Java
Detection engine: Regex
File Extensions
.java
Built-in Providers (12)
LaunchDarkly, Unleash, Split.io, Flipt, Optimizely, Flagsmith, ConfigCat, Statsig, GrowthBook, DevCycle, Eppo, PostHog
LaunchDarkly SDK
import com.launchdarkly.sdk.*;
import com.launchdarkly.sdk.server.*;
LDClient client = new LDClient("sdk-key");
// Variation methods detected
boolean enabled = client.boolVariation("flag-key", context, false);
String value = client.stringVariation("flag-key", context, "default");
int value = client.intVariation("flag-key", context, 0);
double value = client.doubleVariation("flag-key", context, 0.0);
LDValue value = client.jsonValueVariation("flag-key", context, LDValue.ofNull());
Kotlin
Detection engine: Regex
File Extensions
.kt,.kts
Built-in Providers (11)
LaunchDarkly, Unleash, Split.io, Flipt, Optimizely, ConfigCat, Statsig, GrowthBook, DevCycle, Eppo, PostHog (Android)
LaunchDarkly SDK
import com.launchdarkly.sdk.*
import com.launchdarkly.sdk.server.*
val client = LDClient("sdk-key")
// Variation methods detected
val enabled = client.boolVariation("flag-key", context, false)
val value = client.stringVariation("flag-key", context, "default")
val value = client.intVariation("flag-key", context, 0)
Ruby
Detection engine: Regex
File Extensions
.rb,.rake,.gemspec
Built-in Providers (12)
LaunchDarkly, Unleash, Split.io, Flipper, Optimizely, Flagsmith, ConfigCat, Statsig, GrowthBook, DevCycle, Eppo, PostHog
LaunchDarkly SDK
require 'ldclient-rb'
client = LaunchDarkly::LDClient.new("sdk-key")
# Variation methods detected
enabled = client.variation("flag-key", context, false)
value = client.variation_detail("flag-key", context, false)
PHP
Detection engine: Regex
File Extensions
.php,.phtml,.php3,.php4,.php5,.phps
Built-in Providers (9)
LaunchDarkly, Unleash, Split.io, Flagsmith, ConfigCat, Statsig, GrowthBook, PostHog, Laravel Pennant
LaunchDarkly SDK
use LaunchDarkly\LDClient;
$client = new LDClient("sdk-key");
// Variation methods detected
$enabled = $client->variation("flag-key", $context, false);
$enabled = $client->boolVariation("flag-key", $context, false);
$value = $client->stringVariation("flag-key", $context, "default");
$value = $client->intVariation("flag-key", $context, 0);
Swift
Detection engine: Regex
File Extensions
.swift
Built-in Providers (11)
LaunchDarkly (iOS), Unleash (iOS), Split.io (iOS), Optimizely (iOS), Flagsmith (iOS), ConfigCat (iOS), Statsig (iOS), GrowthBook (iOS), DevCycle (iOS), Eppo (iOS), PostHog (iOS)
LaunchDarkly SDK
import LaunchDarkly
let client = LDClient.get()!
// Variation methods detected
let enabled = client.variation(forKey: "flag-key", defaultValue: false)
let value = client.variation(forKey: "flag-key", defaultValue: "default")
C++
Detection engine: Regex
File Extensions
.cpp,.cc,.cxx,.c++,.hpp,.hh,.hxx,.h++,.h,.c
Built-in Providers (5)
LaunchDarkly C++ Server SDK, LaunchDarkly C++ Client SDK, Unleash C++ SDK, ConfigCat C++ SDK, GrowthBook C++ SDK
LaunchDarkly C++ Server SDK
#include <launchdarkly/server_side/client.hpp>
// Server SDK: context is the first argument; flag key is at index 1
client->BoolVariation(context, "flag-key", false);
client->StringVariation(context, "flag-key", "default");
client->IntVariation(context, "flag-key", 0);
client->DoubleVariation(context, "flag-key", 0.0);
client->JsonVariation(context, "flag-key", Value::Null());
LaunchDarkly C++ Client SDK
#include <launchdarkly/client_side/client.hpp>
// Client SDK: single-context, flag key is at index 0
client->BoolVariation("flag-key", false);
client->StringVariation("flag-key", "default");
client->IntVariation("flag-key", 0);
Unleash C++ SDK
#include <unleash/unleashclient.h>
client->isEnabled("feature-toggle");
client->getVariant("feature-toggle");
ConfigCat C++ SDK
#include <configcat/configcat.h>
client->getValue("flag-key", false);
GrowthBook C++ SDK
gb->isOn("feature-key");
gb->getFeatureValue("feature-key", fallbackValue);
Objective-C
Detection engine: Regex
File Extensions
.m,.mm,.h
Built-in Providers (7)
LaunchDarkly (iOS/Objective-C), Unleash (iOS/Objective-C), Split.io (iOS/Objective-C), Optimizely (iOS/Objective-C), Flagsmith (iOS/Objective-C), ConfigCat (iOS/Objective-C), PostHog (iOS/Objective-C)
LaunchDarkly SDK
@import LaunchDarkly;
LDClient *client = [LDClient get];
// Variation methods detected
BOOL enabled = [client boolVariationForKey:@"flag-key" defaultValue:NO];
NSString *value = [client stringVariationForKey:@"flag-key" defaultValue:@"default"];
NSInteger intValue = [client integerVariationForKey:@"flag-key" defaultValue:0];
double doubleValue = [client doubleVariationForKey:@"flag-key" defaultValue:0.0];
Custom Configuration
For custom Objective-C SDKs:
# .flagshark.yml
providers:
- language: objc
name: "Custom Obj-C Flags"
methods:
- name: "isFeatureEnabled:"
flagKeyIndex: 0
- name: "getFeatureValue:default:"
flagKeyIndex: 0
Adding Custom SDKs
If your SDK isn't listed, you can add custom detection patterns in .flagshark.yml. The schema accepts these keys:
# .flagshark.yml
providers:
- language: typescript # required — one of: typescript, javascript, go, python,
# java, kotlin, swift, ruby, csharp, php, rust, cpp, objc
name: "Internal Feature Flags"
importPattern: "company/feature-flags" # optional — only match files that import this
enabled: true # optional — defaults to true
methods:
- name: "isEnabled"
flagKeyIndex: 0 # zero-based index of the flag-key argument
- name: "getValue"
flagKeyIndex: 0
The schema is strict — any key not listed above will cause a validation error.
See Configuration for complete details.
Requesting New Language Support
Need support for a language not listed?
Related Documentation
- Flag Detection - How detection works
- Configuration - Custom provider setup
- Flag Not Detected - Troubleshooting