From 6874f46c534959de834339116a8ab887943c7b14 Mon Sep 17 00:00:00 2001 From: Sameeran Kunche Date: Fri, 17 Jan 2025 15:18:24 -0800 Subject: [PATCH 1/2] fix: include banditActions when instantiating EppoPrecomputedJSClient --- src/i-client-config.ts | 9 +++++---- src/index.ts | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/i-client-config.ts b/src/i-client-config.ts index 5188254..83a34ce 100644 --- a/src/i-client-config.ts +++ b/src/i-client-config.ts @@ -1,11 +1,12 @@ import { - AttributeType, + BanditSubjectAttributes, + ContextAttributes, Flag, IAssignmentLogger, IAsyncStore, IBanditLogger, - BanditActions, } from '@eppo/js-client-sdk-common'; +import type { FlagKey } from '@eppo/js-client-sdk-common/dist/types'; import { ServingStoreUpdateStrategy } from './isolatable-hybrid.store'; @@ -86,12 +87,12 @@ interface IPrecompute { /** * Subject attributes to use for precomputed flag assignments. */ - subjectAttributes?: Record; + subjectAttributes?: BanditSubjectAttributes; /** * Bandit actions to use for precomputed flag assignments. */ - banditActions?: BanditActions; + banditActions?: Record>; } /** diff --git a/src/index.ts b/src/index.ts index ccb4983..17eb7b4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -624,7 +624,7 @@ export async function precomputedInit( const { apiKey, - precompute: { subjectKey, subjectAttributes = {} }, + precompute: { subjectKey, subjectAttributes = {}, banditActions }, baseUrl, requestTimeoutMs, numInitialRequestRetries, @@ -658,6 +658,7 @@ export async function precomputedInit( requestParameters, subject, precomputedBanditStore: memoryOnlyPrecomputedBanditsStore, + banditActions, }); EppoPrecomputedJSClient.instance.setAssignmentLogger(config.assignmentLogger); From ce617e2e060fe6f481e5ea9f4ec624f026c03cc3 Mon Sep 17 00:00:00 2001 From: Sameeran Kunche Date: Fri, 17 Jan 2025 15:20:01 -0800 Subject: [PATCH 2/2] v3.9.5 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 3966238..2feafb0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eppo/js-client-sdk", - "version": "3.9.4", + "version": "3.9.5", "description": "Eppo SDK for client-side JavaScript applications", "main": "dist/index.js", "files": [ @@ -63,4 +63,4 @@ "@eppo/js-client-sdk-common": "4.8.3" }, "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" -} \ No newline at end of file +}