Skip to content

Commit 3b5ceaf

Browse files
committed
Adjust api endpoing for precomputed
1 parent 9a51064 commit 3b5ceaf

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/client/eppo-precomputed-client.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
DEFAULT_REQUEST_TIMEOUT_MS,
1414
DEFAULT_POLL_INTERVAL_MS,
1515
MAX_EVENT_QUEUE_SIZE,
16+
PRECOMPUTED_BASE_URL,
1617
} from '../constants';
1718
import { decodePrecomputedFlag } from '../decoding';
1819
import { FlagEvaluationWithoutDetails } from '../evaluator';
@@ -81,7 +82,7 @@ export default class EppoPrecomputedClient {
8182
apiKey,
8283
sdkName,
8384
sdkVersion,
84-
baseUrl, // Default is set in ApiEndpoints constructor if undefined
85+
baseUrl, // Default is set before passing to ApiEndpoints constructor if undefined
8586
precompute: { subjectKey, subjectAttributes },
8687
requestTimeoutMs = DEFAULT_REQUEST_TIMEOUT_MS,
8788
numInitialRequestRetries = DEFAULT_INITIAL_CONFIG_REQUEST_RETRIES,
@@ -100,7 +101,7 @@ export default class EppoPrecomputedClient {
100101

101102
// todo: Inject the chain of dependencies below
102103
const apiEndpoints = new ApiEndpoints({
103-
baseUrl,
104+
baseUrl: baseUrl ?? PRECOMPUTED_BASE_URL,
104105
queryParams: { apiKey, sdkName, sdkVersion, subjectKey, subjectAttributes },
105106
});
106107
const httpClient = new FetchHttpClient(apiEndpoints, requestTimeoutMs);

src/constants.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ export const DEFAULT_POLL_CONFIG_REQUEST_RETRIES = 7;
77
export const BASE_URL = 'https://fscdn.eppo.cloud/api';
88
export const UFC_ENDPOINT = '/flag-config/v1/config';
99
export const BANDIT_ENDPOINT = '/flag-config/v1/bandits';
10-
export const PRECOMPUTED_FLAGS_ENDPOINT = '/flag-config/v1/precomputed';
10+
export const PRECOMPUTED_BASE_URL = 'https://fs-edge-assignment.eppo.cloud';
11+
export const PRECOMPUTED_FLAGS_ENDPOINT = '/assignments';
1112
export const SESSION_ASSIGNMENT_CONFIG_LOADED = 'eppo-session-assignment-config-loaded';
1213
export const NULL_SENTINEL = 'EPPO_NULL';
1314
// number of logging events that may be queued while waiting for initialization

0 commit comments

Comments
 (0)