-
Notifications
You must be signed in to change notification settings - Fork 26
feat: Environment ID support for hooks #823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Environment ID support for hooks #823
Conversation
@launchdarkly/js-sdk-common size report |
@launchdarkly/js-client-sdk size report |
@launchdarkly/js-client-sdk-common size report |
@@ -615,6 +620,7 @@ export default class LDClientImpl implements LDClient { | |||
defaultValue, | |||
MIGRATION_VARIATION_METHOD_NAME, | |||
() => this._migrationVariationInternal(key, context, defaultValue), | |||
this._featureStore.getInitMetaData?.()?.environmentId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?.()?.
Feels like it is getting close to an emoticon for a boxer.
🤖 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>
Requirements
Describe the solution you've provided
If present,
environmentId
is now passed to the HookRunner in the evaluation series.For streaming connections:
open
event (feat: report event source headers on open js-eventsource#33)StreamingProcessor
passes these headers to the stream listeners viaprocessJson
. The listener for the PUT event extracts theenvironmentId
from the headers and passes this as initialization metadata to the underlying feature store.For polling connections:
PollingProcessor
retrieves the response headers via the underlyingRequestor
and extracts theenvironmentId
from 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 passenvironmentId
in the execution series data.Currently only
InMemoryFeatureStore
has been modified to support initialization metadata. This functionality can be added to other feature stores by modifyinginit()
to accept the optionalinitMetadata
parameter and implementing the optionalgetInitMetadata()
method.