FeatureSignals

Create Your First Flag

This guide walks through creating a feature flag, enabling it per environment, adding targeting rules, and evaluating it from your application.

Step 1: Register and Set Up

After installing FeatureSignals, register at https://app.featuresignals.com. Registration automatically creates:

  • Your user with owner role
  • A default organization
  • A Default Project with environments: dev, staging, production

Step 2: Create a Flag

Navigate to Flags and click Create Flag.

FieldValueDescription
keydark-modeUnique identifier used in code
nameDark ModeHuman-readable label
typebooleanFlag type
default_valuefalseReturned when the flag is disabled

The flag key is immutable after creation and is what your SDKs reference.

Step 3: Enable Per Environment

Flags are disabled by default in all environments. To enable:

  1. Open the flag detail page
  2. Select the dev environment tab
  3. Toggle Enabled to ON
  4. The flag now returns true for all users in dev

Step 4: Add Targeting Rules

Targeting rules let you return specific values based on user attributes:

  1. In the flag's dev environment, click Add Rule
  2. Configure: Condition: country equals US, Value: true
  3. Save

Now only users with country: "US" in their evaluation context get true.

Step 5: Evaluate from Code

typescript
import { FeatureSignalsClient } from '@featuresignals/node';

const client = new FeatureSignalsClient('fs_srv_...', {
  envKey: 'dev',
  baseURL: 'https://api.featuresignals.com',
});

await client.waitForReady();

// User from US gets targeting rule match
const usUser = client.boolVariation('dark-mode', {
  key: 'user-1',
  attributes: { country: 'US' }
}, false);
// → true

// User from UK falls through to default
const ukUser = client.boolVariation('dark-mode', {
  key: 'user-2',
  attributes: { country: 'UK' }
}, false);
// → false

The keyfield is required and uniquely identifies the user. It's used for percentage rollouts and A/B variant assignment via consistent hashing.

Step 6: Gradual Rollout

Instead of enabling for all users, do a percentage rollout:

  1. Set Percentage Rollout to 2500 (25%)
  2. Save

Now 25% of users (deterministically based on their key) see true.

Understanding Evaluation Reasons

ReasonMeaning
DISABLEDFlag is off in this environment
TARGETEDMatched a targeting rule at 100%
ROLLOUTMatched via percentage rollout
FALLTHROUGHFlag enabled but no rules matched
NOT_FOUNDFlag key doesn't exist
PREREQUISITE_FAILEDA prerequisite flag condition wasn't met
MUTUALLY_EXCLUDEDAnother flag in the mutex group won
VARIANTA/B experiment variant assigned

Next Steps