Skip to content

Installation

The Featsync SDK is available as an npm package and works with any JavaScript or TypeScript project.

Package Managers

bash npm install @featsync/sdk

Requirements

  • Node.js 16 or later
  • Works in browsers and Node.js environments
  • TypeScript types included

Importing

import { Featsync } from '@featsync/sdk';

CommonJS

const { Featsync } = require('@featsync/sdk');

Bundle Size

The SDK is lightweight and tree-shakeable:

  • ~4KB minified + gzipped
  • No external dependencies
  • Works with all bundlers (Vite, webpack, esbuild, etc.)

TypeScript

Full TypeScript support is included out of the box:

import { Featsync, FeatsyncConfig, Flag, FlagsMap } from '@featsync/sdk';
const config: FeatsyncConfig = {
apiKey: 'fs_your_api_key',
};
const featsync = new Featsync(config);
const flag: Flag = await featsync.getFlag('my-flag');
const flags: FlagsMap = await featsync.getAllFlags();

Next Steps