skills/featbit-evaluation-insights-api/SKILL.md
Expert guidance for using FeatBit's Flag Evaluation REST API and Track Insights REST API to build custom SDKs for platforms without an official FeatBit SDK. Use when user asks about "evaluation API", "flag evaluation endpoint", "evaluate feature flags via HTTP", "track insights", "insight tracking API", "build custom SDK", "Kotlin SDK", "Android SDK", "iOS SDK", "Swift SDK", "Unity SDK", "embedded SDK", "mobile feature flags", "sendToExperiment", or needs to call FeatBit evaluation server directly. Do not use for management API operations (projects, environments, flag CRUD) — use featbit-rest-api for those. Do not use when an official SDK exists for the target language.
npx skillsauth add featbit/featbit-skills featbit-evaluation-insights-apiInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Direct HTTP access to FeatBit's evaluation server — the foundation for building custom SDKs on any platform (Kotlin, Swift, Android, iOS, Unity, embedded, etc.).
Official documentation:
Activate when users:
sendToExperiment, variation insights, custom metric events, or batch insight payloadsBefore writing any code:
{evaluation-server-url} (e.g., https://eval.your-featbit.com). Found in your FeatBit dashboard under environment settings.Authorization: your-environment-secret-key
See How to get the environment secret
This is the recommended pattern for a custom mobile/frontend SDK:
Step 1 ─ App launch → Evaluate ALL flags (or filtered by tags/keys)
Step 2 ─ Store locally → Cache results in memory for fast synchronous reads
Step 3 ─ Track insights → Fire-and-forget: send evaluation records to FeatBit
Step 4 ─ Poll for updates → Repeat Step 1 periodically using `filter.timestamp`
Step 5 ─ Track metrics → Send custom events (conversion, click, purchase) as they occur
POST {evaluation-server-url}/api/public/featureflag/evaluate
Authorization: your-environment-secret-key
Content-Type: application/json
Minimal request body:
{
"user": {
"keyId": "user-123",
"name": "John Doe",
"customizedProperties": [
{ "name": "country", "value": "US" },
{ "name": "plan", "value": "premium" }
]
}
}
Response — array of flag evaluation results:
[
{
"key": "new-checkout-flow",
"variation": {
"id": "08aceef3-5513-4b38-80ad-4b27bebe8871",
"type": "boolean",
"value": "true",
"matchReason": "premium user rule",
"sendToExperiment": true
}
}
]
Key fields:
variation.value — always a string, cast to the needed type ("true" → boolean, "104857600" → number)variation.sendToExperiment — save this; pass it unchanged when tracking insightsvariation.matchReason — "flag disabled" | "targeted" | "{rule name}" | "default"Narrow the response with filters (essential for reducing payload on mobile):
{
"user": { "keyId": "user-123" },
"filter": {
"keys": ["checkout-flow", "theme-color"],
"tags": ["mobile"],
"tagFilterMode": "and",
"timestamp": 1704067200000
}
}
filter.timestamp— Unix ms. Returns only flags modified after this timestamp. Pass the timestamp from the previous call to implement efficient polling.
Read references/flag-evaluation-api.md for the complete schema, all filter options, and error responses.
Store the response array in memory keyed by flag.key. Serve flag values synchronously from cache — never block UI on a network call.
After evaluating flags, send evaluation records asynchronously.
POST {evaluation-server-url}/api/public/insight/track
Authorization: your-environment-secret-key
Content-Type: application/json
Request body — array of insight objects:
[
{
"user": {
"keyId": "user-123",
"name": "John Doe",
"customizedProperties": [
{ "name": "plan", "value": "premium" }
]
},
"variations": [
{
"featureFlagKey": "new-checkout-flow",
"variation": {
"id": "08aceef3-5513-4b38-80ad-4b27bebe8871",
"value": "true"
},
"sendToExperiment": true,
"timestamp": 1704067200000
}
],
"metrics": []
}
]
Response:
200 OKwith empty body on success. Do not await this in the main UI thread.
Critical:
variation.id, variation.value, and sendToExperiment exactly from the evaluation response. Do not derive or guess these values.variations or metrics must be non-empty in each insight object. A payload where both are empty arrays is a no-op.On a background timer, re-evaluate using filter.timestamp set to the time of the last successful poll. Only changed flags are returned — update your cache with the diff.
When a user performs a meaningful action (purchase, conversion, click):
[
{
"user": { "keyId": "user-123" },
"variations": [],
"metrics": [
{
"route": "/checkout/complete",
"type": "CustomEvent",
"eventName": "purchase-completed",
"numericValue": 99.99,
"appType": "Mobile",
"timestamp": 1704067350000
}
]
}
]
appType— use"Mobile"for Android/iOS apps,"Web"for browser-based apps.
Read references/track-insights-api.md for the complete schema, batch examples, and best practices.
| Scenario | Action |
|---|---|
| Evaluate all flags on launch | POST evaluate with user, no filter |
| Evaluate only mobile-tagged flags | POST evaluate with filter.tags: ["mobile"] |
| Evaluate one specific flag | POST evaluate with filter.keys: ["flag-key"] |
| Detect flag changes since last poll | POST evaluate with filter.timestamp: {lastPollMs} |
| Record which variation user saw | POST track with variations array |
| Record A/B test conversion | POST track with metrics array |
| Record both at once | POST track with both variations and metrics in one payload |
Copy and track progress:
filter.timestamp to pick up flag changesgetFlag(key, defaultValue) helper that reads from cache synchronously| File | Read when |
|---|---|
| references/flag-evaluation-api.md | User asks about exact request/response schema, filter parameters, error codes, or single-flag evaluation |
| references/track-insights-api.md | User asks about insights schema, batching multiple users, MetricInsight fields, or best practices |
tools
Expert guidance for integrating FeatBit JavaScript Client SDK in browser environments. Use when user asks about "JavaScript client SDK", "browser feature flags", "FeatBit JS", "vanilla JS SDK", or mentions browser-side HTML/JS with FeatBit. Do not use for Node.js server-side, React, React Native, .NET, Python, Java, or Go questions.
development
Expert guidance for integrating FeatBit Java Server SDK. Use when user asks about "Java SDK", "Java feature flags", "FeatBit Java", "Maven feature flags", or mentions .java or build.gradle files with FeatBit. Do not use for .NET, Go, Node.js, Python, or JavaScript questions.
development
Expert guidance for integrating FeatBit Go Server SDK. Use when user asks about "Go SDK", "Golang feature flags", "FeatBit Go", or mentions .go files with FeatBit. Do not use for Node.js, Python, Java, .NET, or JavaScript questions.
tools
Expert guidance for integrating FeatBit .NET Server SDK into C# and ASP.NET Core applications. Use when user asks about ".NET SDK", "C# feature flags", "ASP.NET Core FeatBit", "dotnet feature flags", or mentions .cs or .csproj files. Do not use for Node.js, Python, Java, Go, or client-side JavaScript questions.