Skip to content

Conversation

@IDurward
Copy link

@IDurward IDurward commented Jan 2, 2026

Summary

This PR implements @featureboard/openfeature-node-provider\ - an OpenFeature Provider that wraps @featureboard/node-sdk\ to enable FeatureBoard feature flags with the OpenFeature standard.

What's Included

New Package: libs/openfeature-node-provider/

  • Full Provider Implementation: Implements all OpenFeature Provider methods
  • Flexible Audience Mapping: 4-layer priority system (custom mapper, explicit array, property map, defaults)
  • All Update Strategies: Supports \manual, \polling, and \on-request\
  • JSON String Parsing: Automatically parses JSON strings for object-type flags

Test Coverage

  • 57 tests passing, 1 skipped
  • Tests use MSW to mock FeatureBoard API responses

Key Design Decisions

  1. No Features Interface Export: OpenFeature is vendor-agnostic - uses string keys
  2. Peer Dependency: @openfeature/server-sdk\ is a peer dependency
  3. JSON Parsing for Objects: Auto-parses JSON strings for object types

Usage

import { OpenFeature } from '@openfeature/server-sdk'
import { FeatureBoardProvider } from '@featureboard/openfeature-node-provider'

const provider = new FeatureBoardProvider({
    environmentApiKey: 'your-api-key',
})

await OpenFeature.setProviderAndWait(provider)
const client = OpenFeature.getClient()

const value = await client.getBooleanValue('my-feature', false, {
    audiences: ['premium', 'org:acme'],
})

Checklist

  • Package structure created
  • All source files implemented
  • Tests passing (57 passed, 1 skipped)
  • TypeScript compiles cleanly
  • README documentation
  • Changeset created for versioning

Implements OpenFeature Provider for FeatureBoard node-sdk, enabling
FeatureBoard feature flags to work with the OpenFeature standard.

Key features:
- Full Provider interface implementation (boolean, string, number, object flags)
- Flexible audience mapping (custom mapper, explicit array, property map, defaults)
- Support for all update strategies (manual, polling, on-request)
- JSON string parsing for object types
- Comprehensive test coverage (57 tests)

Follows OpenFeature best practices:
- Peer dependency on @openfeature/server-sdk
- No Features interface export (vendor-agnostic pattern)
- Standard resolution reasons and error codes
- Add packageManager field to package.json ([email protected])
- Replace pnpm/action-setup with corepack enable in workflows
- Fixes lockfile compatibility issue in CI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants