feat: Environment ID support for hooks#823
Merged
abarker-launchdarkly merged 2 commits intomainfrom Apr 16, 2025
Merged
Conversation
Contributor
|
@launchdarkly/js-sdk-common size report |
Contributor
|
@launchdarkly/js-client-sdk size report |
Contributor
|
@launchdarkly/js-client-sdk-common size report |
kinyoklion
reviewed
Apr 15, 2025
| defaultValue, | ||
| MIGRATION_VARIATION_METHOD_NAME, | ||
| () => this._migrationVariationInternal(key, context, defaultValue), | ||
| this._featureStore.getInitMetaData?.()?.environmentId, |
Member
There was a problem hiding this comment.
?.()?.
Feels like it is getting close to an emoticon for a boxer.
kinyoklion
approved these changes
Apr 16, 2025
Merged
abarker-launchdarkly
pushed a commit
that referenced
this pull request
Apr 16, 2025
🤖 I have created a release *beep* *boop* --- <details><summary>akamai-edgeworker-sdk-common: 2.0.5</summary> ## [2.0.5](akamai-edgeworker-sdk-common-v2.0.4...akamai-edgeworker-sdk-common-v2.0.5) (2025-04-16) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-server-sdk-common bumped from ^2.14.0 to ^2.15.0 </details> <details><summary>akamai-server-base-sdk: 3.0.5</summary> ## [3.0.5](akamai-server-base-sdk-v3.0.4...akamai-server-base-sdk-v3.0.5) (2025-04-16) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/akamai-edgeworker-sdk-common bumped from ^2.0.4 to ^2.0.5 * @launchdarkly/js-server-sdk-common bumped from ^2.14.0 to ^2.15.0 </details> <details><summary>akamai-server-edgekv-sdk: 1.4.7</summary> ## [1.4.7](akamai-server-edgekv-sdk-v1.4.6...akamai-server-edgekv-sdk-v1.4.7) (2025-04-16) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/akamai-edgeworker-sdk-common bumped from ^2.0.4 to ^2.0.5 * @launchdarkly/js-server-sdk-common bumped from ^2.14.0 to ^2.15.0 </details> <details><summary>browser-telemetry: 1.0.6</summary> ## [1.0.6](browser-telemetry-v1.0.5...browser-telemetry-v1.0.6) (2025-04-16) ### Dependencies * The following workspace dependencies were updated * devDependencies * @launchdarkly/js-client-sdk bumped from 0.5.2 to 0.5.3 </details> <details><summary>cloudflare-server-sdk: 2.7.4</summary> ## [2.7.4](cloudflare-server-sdk-v2.7.3...cloudflare-server-sdk-v2.7.4) (2025-04-16) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-server-sdk-common-edge bumped from 2.6.3 to 2.6.4 </details> <details><summary>fastly-server-sdk: 0.1.5</summary> ## [0.1.5](fastly-server-sdk-v0.1.4...fastly-server-sdk-v0.1.5) (2025-04-16) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-server-sdk-common bumped from 2.14.0 to 2.15.0 </details> <details><summary>jest: 0.1.4</summary> ## [0.1.4](jest-v0.1.3...jest-v0.1.4) (2025-04-16) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/react-native-client-sdk bumped from ~10.9.8 to ~10.9.9 </details> <details><summary>js-client-sdk: 0.5.3</summary> ## [0.5.3](js-client-sdk-v0.5.2...js-client-sdk-v0.5.3) (2025-04-16) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-client-sdk-common bumped from 1.12.5 to 1.12.6 </details> <details><summary>js-client-sdk-common: 1.12.6</summary> ## [1.12.6](js-client-sdk-common-v1.12.5...js-client-sdk-common-v1.12.6) (2025-04-16) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-sdk-common bumped from 2.15.0 to 2.16.0 </details> <details><summary>js-sdk-common: 2.16.0</summary> ## [2.16.0](js-sdk-common-v2.15.0...js-sdk-common-v2.16.0) (2025-04-16) ### Features * Environment ID support for hooks ([#823](#823)) ([63dc9f9](63dc9f9)) </details> <details><summary>js-server-sdk-common: 2.15.0</summary> ## [2.15.0](js-server-sdk-common-v2.14.0...js-server-sdk-common-v2.15.0) (2025-04-16) ### Features * Environment ID support for hooks ([#823](#823)) ([63dc9f9](63dc9f9)) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-sdk-common bumped from 2.15.0 to 2.16.0 </details> <details><summary>js-server-sdk-common-edge: 2.6.4</summary> ## [2.6.4](js-server-sdk-common-edge-v2.6.3...js-server-sdk-common-edge-v2.6.4) (2025-04-16) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-server-sdk-common bumped from 2.14.0 to 2.15.0 </details> <details><summary>node-server-sdk: 9.9.0</summary> ## [9.9.0](node-server-sdk-v9.8.0...node-server-sdk-v9.9.0) (2025-04-16) ### Features * Environment ID support for hooks ([#823](#823)) ([63dc9f9](63dc9f9)) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-server-sdk-common bumped from 2.14.0 to 2.15.0 </details> <details><summary>node-server-sdk-dynamodb: 6.2.9</summary> ## [6.2.9](node-server-sdk-dynamodb-v6.2.8...node-server-sdk-dynamodb-v6.2.9) (2025-04-16) ### Dependencies * The following workspace dependencies were updated * devDependencies * @launchdarkly/node-server-sdk bumped from 9.8.0 to 9.9.0 * peerDependencies * @launchdarkly/node-server-sdk bumped from >=9.4.3 to >=9.9.0 </details> <details><summary>node-server-sdk-otel: 1.2.0</summary> ## [1.2.0](node-server-sdk-otel-v1.1.8...node-server-sdk-otel-v1.2.0) (2025-04-16) ### Features * Environment ID support for hooks ([#823](#823)) ([63dc9f9](63dc9f9)) ### Dependencies * The following workspace dependencies were updated * devDependencies * @launchdarkly/node-server-sdk bumped from 9.8.0 to 9.9.0 * peerDependencies * @launchdarkly/node-server-sdk bumped from >=9.4.3 to >=9.9.0 </details> <details><summary>node-server-sdk-redis: 4.2.9</summary> ## [4.2.9](node-server-sdk-redis-v4.2.8...node-server-sdk-redis-v4.2.9) (2025-04-16) ### Dependencies * The following workspace dependencies were updated * devDependencies * @launchdarkly/node-server-sdk bumped from 9.8.0 to 9.9.0 * peerDependencies * @launchdarkly/node-server-sdk bumped from >=9.4.3 to >=9.9.0 </details> <details><summary>react-native-client-sdk: 10.9.9</summary> ## [10.9.9](react-native-client-sdk-v10.9.8...react-native-client-sdk-v10.9.9) (2025-04-16) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-client-sdk-common bumped from 1.12.5 to 1.12.6 </details> <details><summary>server-sdk-ai: 0.9.6</summary> ## [0.9.6](server-sdk-ai-v0.9.5...server-sdk-ai-v0.9.6) (2025-04-16) ### Dependencies * The following workspace dependencies were updated * devDependencies * @launchdarkly/js-server-sdk-common bumped from 2.14.0 to 2.15.0 * peerDependencies * @launchdarkly/js-server-sdk-common bumped from 2.x to 2.15.0 </details> <details><summary>vercel-server-sdk: 1.3.28</summary> ## [1.3.28](vercel-server-sdk-v1.3.27...vercel-server-sdk-v1.3.28) (2025-04-16) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-server-sdk-common-edge bumped from 2.6.3 to 2.6.4 </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.
Requirements
Describe the solution you've provided
If present,
environmentIdis now passed to the HookRunner in the evaluation series.For streaming connections:
openevent (feat: report event source headers on open js-eventsource#33)StreamingProcessorpasses these headers to the stream listeners viaprocessJson. The listener for the PUT event extracts theenvironmentIdfrom the headers and passes this as initialization metadata to the underlying feature store.For polling connections:
PollingProcessorretrieves the response headers via the underlyingRequestorand extracts theenvironmentIdfrom the headers and passes this as initialization metadata to the underlying feature store.LDClient will then call
getInitMetaData()on the underlying feature store (if the feature store supports it) when executing a hook and passenvironmentIdin the execution series data.Currently only
InMemoryFeatureStorehas been modified to support initialization metadata. This functionality can be added to other feature stores by modifyinginit()to accept the optionalinitMetadataparameter and implementing the optionalgetInitMetadata()method.