Skip to content

Conversation

@jonathannorris
Copy link
Member

Summary

Refactors the multi-provider implementation by moving duplicate code from @openfeature/server-sdk and @openfeature/web-sdk into @openfeature/shared.

Changes

  • Moved to shared package:

    • StatusTracker - Generic status tracking for multiple providers
    • BaseEvaluationStrategy and concrete strategy implementations (FirstMatchStrategy, FirstSuccessfulStrategy, ComparisonStrategy)
    • Multi-provider error handling utilities
    • Common multi-provider types (ProviderEntryInput, RegisteredProvider)
  • Made generic and type-safe:

    • All shared types now use proper generic type parameters (TProviderStatus, TProvider)
    • Removed all any types in favor of explicit generic constraints
    • Added proper type constraints to StatusTracker for provider compatibility
  • Updated implementations:

    • Server and web multi-provider implementations now import and use shared code
    • Both SDKs specify their concrete types (ProviderStatus, Provider) when using shared utilities
    • Maintained full type safety across all packages

Cleanup: removing `release-as` properties from release-please config
after successfully validating OIDC npm publishing.

<!-- av pr metadata
This information is embedded by the av CLI when creating PRs to track
the status of stacks when using Aviator. Please do not delete or edit
this section of the PR.
```
{"parent":"main","parentHead":"","trunk":"main"}
```
-->

Signed-off-by: Jonathan Norris <jonathan@taplytics.com>
This PR migrates the `MultiProvider` functionality from the
[js-sdk-contrib](https://github.com/open-feature/js-sdk-contrib)
repository into the main js-sdk, providing built-in support for
multi-provider evaluation strategies. Addresses #1217

### What's Changed
- **Added `MultiProvider`** for server SDK with support for multiple
evaluation strategies
- **Added `WebMultiProvider`** for web SDK with web-specific
optimizations
- **Included 3 evaluation strategies**: FirstMatch, FirstSuccessful, and
Comparison
- **Comprehensive test coverage** for both server and web
implementations
- **Updated documentation** with usage examples and strategy
explanations

### Testing
- ✅ All existing tests pass
- ✅ New comprehensive test suites for both server and web MultiProvider
- ✅ ESLint compliance across all new code

---------

Signed-off-by: Jonathan Norris <jonathan@taplytics.com>
# Conflicts:
#	packages/web/src/provider/multi-provider/status-tracker.ts
…types

Signed-off-by: Jonathan Norris <jonathan@taplytics.com>
@jonathannorris jonathannorris force-pushed the feat-shared-multi-provider branch from 92cf47a to 847278f Compare October 21, 2025 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant