Installation Guide
Get started with @pursuit-amsterdam/feature-flags in your React application
Table of Contents
Prerequisites
What you need before installing the library
Requirements
System Requirements
Framework Compatibility
NPM Installation
Install using NPM package manager
If you're using NPM as your package manager, run the following command in your project directory:
npm install @pursuit-amsterdam/feature-flagsDevelopment Dependencies
Yarn Installation
Install using Yarn package manager
If you prefer Yarn, use this command instead:
yarn add @pursuit-amsterdam/feature-flagsYarn Workspaces
If you're using Yarn workspaces in a monorepo setup, you can install the package for a specific workspace:
yarn workspace your-app-name add @pursuit-amsterdam/feature-flagsPNPM Installation
Install using PNPM package manager
For PNPM users, the installation command is:
pnpm add @pursuit-amsterdam/feature-flagsPNPM Workspaces
In a PNPM workspace, you can install for a specific package:
pnpm add @pursuit-amsterdam/feature-flags --filter your-app-nameThis Demo Uses PNPM
Verify Installation
Make sure everything is working correctly
After installation, verify that the library is correctly installed by creating a simple test file:
import {
FlagsProvider,
useFeatureFlags,
Flags
} from '@pursuit-amsterdam/feature-flags';
// If this imports without errors, installation was successful!
console.log('Feature flags library installed successfully!');
// Basic type check
const testConfig = {
myFlag: true,
anotherFlag: false,
} as const;
// This should compile without TypeScript errors
type TestFlags = typeof testConfig;Check Package Version
You can verify the installed version using your package manager:
npm list @pursuit-amsterdam/feature-flagsyarn list @pursuit-amsterdam/feature-flagspnpm list @pursuit-amsterdam/feature-flagsBuild Errors?
Next Steps
What to do after successful installation
Great! You've successfully installed the feature flags library. Now it's time to configure it in your application.
Configuration Setup
Learn how to set up the FlagsProvider and configure your first feature flags.
Alternative: Browse Examples
If you prefer to see examples first, you can explore the component demos.
Quick Start Template
Want to jump straight into a working example? Copy this minimal setup:
import React from 'react';
import { FlagsProvider, Flags } from '@pursuit-amsterdam/feature-flags';
const flags = {
newFeature: true,
betaUI: false,
} as const;
function App() {
return (
<FlagsProvider config={flags}>
<div>
<h1>My App</h1>
<Flags authorizedFlags="newFeature">
<p>This is a new feature!</p>
</Flags>
</div>
</FlagsProvider>
);
}
export default App;