flags
Documentation

Client SDK

Lightweight JavaScript SDK to read feature flags by repository branch.

Minimal API
Two methods: getFlags and isFlagEnabled.
Branch-aware
Read different values for main, staging, and feature branches.
Git workflow
Define flags in code and sync automatically through webhook updates.
Import
import { getFlags, isFlagEnabled } from 'https://flags.salteadorneo.dev/client.js';
getFlags(options)

Fetches all feature flags for a repository token and branch.

  • token required repository API token
  • branch required branch name
  • apiUrl optional endpoint URL
const flags = await getFlags({
  token: 'your-token',
  branch: 'main'
});
isFlagEnabled(flags, key, fallback?)

Returns a boolean for a flag key.

  • flags flags object from getFlags
  • key flag key to evaluate
  • fallback optional default value
if (isFlagEnabled(flags, 'new_checkout')) {
  renderNewCheckout();
}
Integration flow

Copy your repository API token

Import the client SDK

Call getFlags with a branch

Gate UI with isFlagEnabled