Developer Interface

API Reference

Powerful REST API to automate your feature flag workflows and integrate with your existing CI/CD pipelines.

SDK Integration

Learn how to use our official SDK to evaluate feature flags in your application.

Installation

Select your preferred package manager to install the Easy Flags SDK.

npm
npm install @orange-ember/easy-flags-sdk
yarn
yarn add @orange-ember/easy-flags-sdk
pnpm
pnpm add @orange-ember/easy-flags-sdk

Usage

Initialize the client and start evaluating flags in your code.

1. Initialize the Client

Import and initialize the EasyFlagsClient with your API Key, Space ID, and Environment ID.

JavaScript / TypeScript
import { EasyFlagsClient } from "@orange-ember/easy-flags-sdk";

const client = new EasyFlagsClient({
  apiKey: "YOUR_API_KEY",
  spaceId: "YOUR_SPACE_ID",
  environmentId: "YOUR_ENVIRONMENT_ID",
});

2. Evaluate a Flag

Check if a feature is enabled or get its value using the evaluate method.

JavaScript
const isFeatureEnabled = await client.evaluate("new-navigation", {
  defaultValue: false,
});

if (isFeatureEnabled) {
  // Render new navigation
}

3. Advanced Targeting (TypeScript)

Pass a userId and context for advanced segmentation and deterministic rollouts.

TypeScript
const themeColor = await client.evaluate<string>("user-theme", {
  defaultValue: "#ffffff",
  userId: "user_789", // Required for deterministic rollouts
  context: {
    plan: "premium",
    version: "2.4.0"
  }
});

Configuration Options

Property Type Description
apiKey string Your Easy Flags API Key.
spaceId string The ID of your Space.
environmentId string The ID of your Environment.
cacheTTL number Cache TTL in seconds (default: 60).
timeout number API request timeout in ms (default: 5000).
Available Endpoints
POST /api/auth/login

Authenticate a user and get a JWT token.

GET /api/spaces

List all spaces for the authenticated user.

Requires a valid JWT token in the Authorization header.
POST /api/spaces/:spaceId/features

Create a new feature in the specified space.

Requires a valid JWT token in the Authorization header.
GET /api/spaces/:spaceId/environments

Get all environments in a space.

Requires a valid JWT token in the Authorization header.
GET/POST /api/features/:featureKey/evaluate

Evaluate a specific feature flag for a context and environment.

Requires a valid JWT token in the Authorization header.
Requires an environment API Key.

Need a custom integration?

Our API is built for scale. If you have specific needs, reach out to our team.

Contact Support