A standalone tool for testing Flagmint's SDK protocol without writing code
Built for QA engineers, demos, and debugging
This app connects directly to your Flagmint API using the raw wire protocol (WebSocket or HTTP long-polling). It does not use any Flagmint SDK β this is intentional, so you're testing the server contract, not the SDK's interpretation of it.
Perfect for:
- β QA testing and validation
- π Debugging feature flag behavior
- π― Testing targeting rules and context evaluation
- π Verifying real-time updates
- π Comparing WebSocket vs long-polling transport
- Option A: Node.js 16+ and npm
- Option B: Docker and Docker Compose
- A Flagmint API instance (local or remote)
- A valid SDK key from your Flagmint environment
# Clone or download this repository
cd flagmint-sdk-tester
# Install dependencies
npm install
# Start the development server
npm run devOpen http://localhost:5173 in your browser, paste your SDK key, and connect!
Using Docker Compose (Easiest):
# Development mode (with hot reload)
docker-compose up dev
# Production mode (optimized build)
docker-compose up prodUsing Docker directly:
# Development mode
docker build --target development -t flagmint-sdk-tester:dev .
docker run -p 5173:5173 -v $(pwd):/app -v /app/node_modules flagmint-sdk-tester:dev
# Production mode
docker build --target production -t flagmint-sdk-tester:prod .
docker run -p 3000:3000 flagmint-sdk-tester:prodAccess the application:
- Development: http://localhost:5173
- Production: http://localhost:3000
npm run build
npm run preview- Dual Transport Support β Switch between WebSocket and HTTP long-polling
- Connection Status β Real-time visual indicators for connection state
- Auto-reconnect β Graceful handling of disconnections
- Visual Context Builder β Add/remove key-value pairs via UI
- Context Presets β Quick setups for common scenarios:
- Simple User β Basic
{ kind: 'user', key: '...' }context - Multi-Context β Complex
{ kind: 'multi', user: {...}, organization: {...} }structure - Empty β No context (tests default evaluation paths)
- Simple User β Basic
- Nested Context Support β Use dot notation (e.g.,
user.key,organization.plan) - Type Inference β Automatically converts
true,false, and numeric strings
- Live Flag Values β See all flags with current values
- Type Badges β Visual indicators for boolean, string, number, JSON, and null types
- Real-Time Updates β Watch flags change instantly when modified in dashboard
- Change History β Expand any flag to see its value history over time
- Flag Search β Filter flags by name for large projects
- Message Inspector β View raw WebSocket messages
- Connection Events β Track connect, disconnect, and error events
- Debug Mode β Toggle verbose logging for troubleshooting
- Auto-scroll β Automatically follows latest log entries
-
Configure Connection
- Enter your API URL (e.g.,
http://localhost:3000) - Paste your SDK key
- Choose transport: WebSocket (recommended) or long-polling
- Enter your API URL (e.g.,
-
Set Up Context
- Use a preset or manually add context fields
- Example user context:
kind: user key: test-user-123 country: US plan: pro
-
Connect & Test
- Click "Connect" β connection status will turn green
- Click "Send Context" to evaluate flags with your context
- All matching flags will appear in the Flags tab
-
Verify Real-Time Updates
- Open Flagmint dashboard in another tab
- Toggle a flag value or targeting rule
- Watch the tester update instantly (WebSocket)
Context:
kind: user
key: alice@example.com
email: alice@example.com
plan: enterprise
Verify flags target based on email domain or plan level.
Context:
kind: multi
user.kind: user
user.key: alice@example.com
organization.kind: organization
organization.key: acme-corp
organization.plan: enterprise
Verify organization-level flags override user-level defaults.
Context: (empty)
Verify default fallback values are returned correctly.
- Flag evaluates with correct default value
- Flag respects user targeting rules
- Flag respects multi-context targeting
- Flag updates in real-time when changed in dashboard
- WebSocket connection is stable (no disconnects)
- Long-polling fallback works correctly
- Empty context returns expected defaults
- Custom context attributes are evaluated correctly
- Change history accurately tracks flag value changes
flagmint-sdk-tester/
βββ src/
β βββ main.jsx # React entry point
β βββ App.jsx # Main app component (UI, state management)
β βββ connection.js # Flagmint protocol client (WebSocket + long-polling)
β βββ helpers.js # Utilities (type helpers, presets, context builder)
βββ index.html # HTML template
βββ package.json # Dependencies and scripts
βββ vite.config.js # Vite configuration
βββ README.md # This file
connection.jsβ Raw protocol implementation. Handles WebSocket connections, long-polling, message parsing, and keep-alive pings.helpers.jsβ Context building logic, type detection, and preset configurations.App.jsxβ Complete UI with connection panel, context builder, flag viewer, and log inspector.
Default: http://localhost:3000
Update in the UI or set via localStorage:
localStorage.setItem('fm_tester_url', 'https://your-api.com');Stored securely in localStorage (input type=password). Never committed to version control.
If your Flagmint API runs on a different origin, ensure CORS allows:
Access-Control-Allow-Origin: http://localhost:5173
Access-Control-Allow-Methods: POST, GET, OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization
- React 19 β UI framework
- Vite β Build tool and dev server
- WebSocket API β Real-time communication
- Fetch API β Long-polling fallback
- Local Storage β Persistent configuration
No external dependencies for networking or UI β pure browser APIs.
- β Verify API URL is correct and reachable
- β Check API key is valid for the environment
- β Ensure API is running and healthy
- β Check CORS configuration (see browser console for errors)
- β Verify SDK key has access to flags
- β Check context matches targeting rules
- β Try empty context to see default values
- β Check Protocol Log tab for server responses
- β Check API WebSocket endpoint is stable
- β Try long-polling transport as fallback
- β Verify no firewall/proxy blocking WebSocket connections
- β Check API logs for errors
- β Verify context structure matches expected format
- β Check targeting rules in Flagmint dashboard
- β Review change history to see if value recently updated
- β Enable Debug mode in Protocol Log to see evaluation details
This is a testing tool for Flagmint SDK validation. Contributions welcome!
- Fork the repository
- Create a feature branch (
git checkout -b feature/improvement) - Commit your changes (
git commit -am 'Add new feature') - Push to the branch (
git push origin feature/improvement) - Open a Pull Request
MIT License - see LICENSE file for details