This folder contains sample applications demonstrating Flagent SDK and plugins for various platforms and programming languages.
From the repository root, run Flagent and the Ktor sample in one go:
./scripts/run-golden-path.shOr: make golden-path. This starts Flagent (Docker Compose), waits for health, optionally seeds the new_payment_flow flag, and runs the Ktor sample. Flagent UI: http://localhost:18000, sample: http://localhost:8080. See Getting Started.
Android application demonstrating the usage of Flagent Kotlin SDK for Android.
Features:
- Single flag evaluation
- Batch evaluation
- Enhanced SDK with caching
- Debug UI
Run:
cd samples/android
./gradlew buildWeb application with HTML/JavaScript demonstrating Flagent API usage.
Features:
- Single flag evaluation
- Batch evaluation
- Entity context support
- Debug mode
Run:
# Open index.html in browser
open samples/javascript/index.htmlKotlin/JVM console application demonstrating Flagent Kotlin SDK usage.
Features:
- Single flag evaluation
- Batch evaluation
- Flag ID evaluation
- Basic and Enhanced SDK
Run:
# From monorepo root
./gradlew :sample-kotlin:runSwift console application demonstrating Flagent Swift SDK usage.
Features:
- Single flag evaluation
- Batch evaluation
- Flag ID evaluation
- Basic and Enhanced SDK
Run:
cd samples/swift
swift build
swift runDart console application demonstrating the usage of Flagent Flutter/Dart SDK.
Features:
- Single flag evaluation
- Batch evaluation
- Flag ID evaluation
- Enhanced SDK with caching
Run:
cd samples/flutter
dart pub get
dart run bin/main.dartFlutter application with UI (Material): Home, Evaluate, and Debug screens.
Features:
- Single flag evaluation form and result display
- Debug screen: evaluate form, cache actions (clear / evict), last evaluations list
- Uses
flagent_enhancedwith caching
Run:
cd samples/flutter_app
flutter create . --org com.flagent # first time: generate android/ios
flutter pub get
flutter runReference code for using Flagent SDK in React Native. Uses @flagent/client and @flagent/enhanced-client.
See: sdk/REACT_NATIVE.md for full integration guide.
Ktor application sample demonstrating Flagent Ktor plugin usage.
Features:
- Flagent plugin integration
- Custom endpoints with evaluation
- Batch evaluation
- Cache usage
- Plugin endpoints
Run:
# From monorepo root
./gradlew :sample-ktor:runBefore running any sample, ensure the Flagent backend server is running.
One-command option (from repo root): run Flagent and the Ktor sample together:
./scripts/run-golden-path.shFlagent UI at http://localhost:18000, Ktor sample at http://localhost:8080. See Getting Started — Golden path.
Manual: start the backend, then run the sample:
# From repo root: start Flagent (Docker)
docker compose up -d
# Or from backend dir: run from source
cd backend && ./gradlew runThe server will start on http://localhost:18000 by default.
samples/
├── android/ # Android sample (Compose UI, includes SDK Debug UI)
├── javascript/ # JavaScript/HTML sample
├── kotlin/ # Kotlin/JVM console sample
├── swift/ # Swift console sample
├── flutter/ # Flutter/Dart console sample
├── flutter_app/ # Flutter app with UI (Home, Evaluate, Debug)
├── react-native/ # React Native reference
├── ktor/ # Ktor plugin sample
├── spring-boot/ # Spring Boot plugin sample
└── README.md # This file
| Sample | Has UI | SDK Debug UI integrated |
|---|---|---|
| Android | Yes (Compose) | Yes — kotlin-debug-ui on Debug tab |
| Flutter App | Yes (Material) | Debug tab in-app (form, cache, last evals) |
| JavaScript | Yes (HTML) | Debug mode checkbox only (no React Debug Panel) |
| Swift | No (CLI) | — |
| Flutter (console) | No (CLI) | — |
| Kotlin, Ktor, Spring Boot | No | — |
The Android sample uses the SDK Debug UI module (kotlin-debug-ui). The Flutter App sample implements its own Debug tab (evaluate form, cache actions, last evaluations) in Flutter; there is no separate Flutter Debug UI package in the SDK. Swift and the Flutter console sample are CLI-only.
Apache 2.0 - See parent project license