Feature Flags
Control feature access with fine-grained targeting. Roll out new capabilities gradually, run experiments, and instantly disable features without deploying.
Feature Flag Manager
Targeting Options
Enable for everyone
Gradual rollout by %
Target specific groups
Schedule activation
API Reference
# Check if a feature is enabled for a user
curl https://api.justkalm.com/v2/features/multi_image_analysis \
-H "Authorization: Bearer jk_live_xxx" \
-d '{"user_id": "user_123"}'
# Response
{
"key": "multi_image_analysis",
"enabled": true,
"variant": "treatment",
"reason": "rule_match"
}# Get all feature flags for a user
curl https://api.justkalm.com/v2/features \
-H "Authorization: Bearer jk_live_xxx" \
-d '{"user_id": "user_123"}'
# Response
{
"flags": {
"multi_image_analysis": true,
"streaming_responses": true,
"ai_condition_grading": false,
"batch_v2": false
},
"evaluated_at": "2024-01-15T10:30:00Z"
}import { JustKalm } from '@justkalm/sdk';
const client = new JustKalm({ apiKey: process.env.JUSTKALM_API_KEY });
// Check single flag
const isEnabled = await client.features.isEnabled('multi_image_analysis', {
userId: 'user_123',
attributes: {
plan: 'enterprise',
country: 'US',
},
});
// Get all flags for user context
const flags = await client.features.evaluate({
userId: 'user_123',
attributes: { plan: 'enterprise' },
});
if (flags['streaming_responses']) {
// Use streaming endpoint
}# Create a new feature flag
curl -X POST https://api.justkalm.com/v2/features \
-H "Authorization: Bearer jk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"key": "new_pricing_model",
"name": "New Pricing Model",
"description": "Test new per-image pricing",
"targeting": {
"rules": [
{
"segment": "beta_users",
"percentage": 50
}
],
"default_variant": false
}
}'Use Cases
๐ Gradual Rollouts
Release new features to 1%, 5%, 25%, then 100% of users. Monitor metrics at each stage and rollback instantly if issues arise.
๐งช A/B Testing
Split users into variants and measure impact on key metrics. Built-in statistical significance calculations.
๐ฏ User Targeting
Enable features for specific plans, regions, or user segments. Beta programs, enterprise-only features, regional availability.
๐ด Kill Switches
Instantly disable problematic features without deploying code. Critical for incident response and system reliability.
Ship with Confidence
Control access to new API features with fine-grained targeting.