refactor!: migrate OpenFeature providers to the thin Confidence client - #461
Draft
andreas-karlsson wants to merge 6 commits into
Draft
andreas-karlsson wants to merge 6 commits into
andreas-karlsson wants to merge 6 commits into
Conversation
Add ConfidenceClient.publish, sending one event or a batch in a single request, and implement the OpenFeature tracking API on both providers. Nothing is queued: the request goes out on call, with keepalive in browsers so an event fired just before a navigation still arrives. payload.context carries attribution, and eventTime is per event so a batching layer built on top can preserve real event timing. Replace ConfidenceClient's url option with region, which places both the resolver and the events service — events are a separate service carrying data of their own, so one url could never put both in the right region. Rewriting URLs outright stays possible through fetch. BREAKING CHANGE: The OpenFeature peer floors move to web-sdk >=1.3.2 and server-sdk >=1.16.0, the earliest releases exposing track against a core that has the tracking types. BREAKING CHANGE: ConfidenceClient.Options.flagClientSecret is renamed clientSecret, and its url option is replaced by region. Pass a fetch that rewrites the URL to reach a resolver of your own. BREAKING CHANGE: ConfidenceClient.ApplyResult is renamed WriteResult, which publish returns too. BREAKING CHANGE: The resolveBaseUrl option is removed from both provider factories, superseded by region plus the fetch escape hatch. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
6 tasks
Co-authored-by: Codex <noreply@openai.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Move both OpenFeature providers from the stateful
ConfidenceAPI toConfidenceClientand serializableFlagBundleresults. Server evaluations resolve and apply the requested flag per call; the web provider resolves per context and records exposure only for evaluated flags.Add event publishing through OpenFeature tracking with attribution from the effective evaluation context. Harden delivery with request deadlines, UTF-8-aware keepalive sizing, page-hide exposure flushing, one bounded retry for transient exposure failures, and shutdown that drains pending writes. Events are not automatically retried because an ambiguous failure could produce duplicates. Malformed publish responses report failure instead of success.
Compatibility and release
0.4.0; both providers require>=0.4.0 <0.5.0. Widen the existing React package's SDK peer range because the legacyConfidenceAPI remains available.Confidenceinstances; provider constructors useConfidenceClient.clientSecretandregion; custom routing goes through the fetch transport.WriteResultreplacesApplyResult.1.3.2and server SDK1.16.0.Validation
6a524b4: Build-And-Test, Build-And-Test-CSR, E2E-Test, and commit validation. The legacy SDK E2E assertion now matches the unprefixed flag-name contract.concepts/migrate-to-thin-client.md; checked syntax in 41 TypeScript snippets and relative documentation links.✔️ Checklist