Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

# Node.js SDK Demo

This is a demo Express app showcasing the @flagsync/node-sdk for feature flag usage.

✨ Features

  • Type-safe flag evaluation
  • Event tracking
  • Real-time flag updates
  • FlagSync CLI included (@flagsync/cli)

🚀 Quick Start

  1. Add your FlagSync SDK key to .env:
    FLAGSYNC_SDK_KEY=your-key-here

    To find this, navigate to the desired workspace environment from the Dashboard. Be sure to use a server-side SDK key.

  2. Install dependencies and start the dev server:
    npm install
    npm run dev
  3. Visit http://localhost:3000/ to see the flag value.
  4. Toggle the flag in the Flags Dashboard and refresh to see changes.

🖥️ FlagSync CLI

Optional, but highly recommended

Run the FlagSync CLI to get full type safety and autocompletion when accessing flags:

npm run generate

🔧 Example Response

{
  "flag": {
    "key": "my-first-kill-switch",
    "value": false
  },
  "algorithm": "v1-rules-based",
  "result": [
    "itemX",
    "itemY",
    "itemZ"
  ]
}

📖 Documentation

For more detailed information about the SDK features and usage, visit: