Skip to content

Conversation

@adams85
Copy link
Contributor

@adams85 adams85 commented Sep 3, 2025

This PR

Updates ConfigCat providers to use the new, unified ConfigCat SDK for JavaScript.

Also, improves the evaluation context to user object mapping to match the behavior of other ConfigCat OpenFeature providers. This comes with some minor breaking changes though:

  • The targetingKey property is also included in the custom user attributes.
  • If targetingKey is not specified, a User Object is still created and the identifier attribute is used as a fallback. In case that's not specified either, the SDK will use an empty string as the user identifier during feature flag evaluation.

Follow-up Tasks

The PR introduces significant breaking changes, so it should be released with an increased major version.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @adams85, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on a significant upgrade of the ConfigCat OpenFeature providers by integrating the new, unified ConfigCat SDK. This modernization effort streamlines the underlying SDK usage and refines how user context is translated for feature flag evaluations, ensuring consistency and robustness across the providers. The changes also improve the readiness signal for the providers, making their state more transparent.

Highlights

  • SDK Migration: The ConfigCat providers have been updated to use the new, unified ConfigCat SDK for JavaScript, replacing the separate configcat-js-ssr and configcat-node packages. This simplifies dependency management and aligns with the latest SDK architecture.
  • Improved Evaluation Context Mapping: The mapping of evaluation context to ConfigCat user objects has been enhanced to match the behavior of other ConfigCat OpenFeature providers. This includes: 1. The targetingKey property is now explicitly included in the custom user attributes. 2. If targetingKey is not specified, the identifier attribute is used as a fallback for the user identifier. If neither is present, the SDK will use an empty string.
  • Updated Error Handling and Event Emission: The providers now leverage the new EvaluationErrorCode from the unified SDK for more precise error translation, replacing the previous string-based error parsing. Additionally, the PROVIDER_READY event is now emitted more reliably based on the ConfigCat client's initialization state via its configChanged hook.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a significant and well-executed update, migrating the ConfigCat providers to the new unified ConfigCat SDK. The changes bring several improvements, including more robust error handling using error codes instead of string parsing, and a much cleaner provider readiness logic. The evaluation context mapping has been updated to align with other ConfigCat providers, which is a welcome standardization, although it introduces some breaking changes as noted in the description.

I've identified a high-severity issue regarding type safety when handling the identifier in the evaluation context, and a couple of medium-severity documentation inconsistencies that should be addressed to avoid confusion for developers using these providers.

Signed-off-by: Adam Simon <[email protected]>
@adams85 adams85 changed the title chore: Update ConfigCat providers to use the new ConfigCat SDK chore(config-cat): Update ConfigCat providers to use the new ConfigCat SDK Sep 3, 2025
@adams85 adams85 force-pushed the update-configcat-sdk branch from 36ad932 to 6561083 Compare September 4, 2025 15:22
@lukas-reining lukas-reining merged commit ae20bc8 into open-feature:main Sep 7, 2025
7 checks passed
Zaimwa9 pushed a commit to Flagsmith/js-sdk-contrib that referenced this pull request Sep 25, 2025
thomaspoignant pushed a commit that referenced this pull request Nov 19, 2025
…t SDK (#1371)

Signed-off-by: Adam Simon <[email protected]>
Co-authored-by: Adam Simon <[email protected]>
Signed-off-by: Thomas Poignant <[email protected]>
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