From d4929c3d90dec1e4de3c8fd7983107540b1da38e Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Wed, 19 Feb 2025 22:06:29 +0600 Subject: [PATCH] [FSSDK-10992] export clientEngine from entrypoint This will help debug issues where incorrect entrypoint is used by a client --- lib/entrypoint.test-d.ts | 3 +++ lib/index.browser.ts | 3 +++ lib/index.node.ts | 2 ++ lib/index.react_native.ts | 2 ++ 4 files changed, 10 insertions(+) diff --git a/lib/entrypoint.test-d.ts b/lib/entrypoint.test-d.ts index 393a7cdb8..a9a782522 100644 --- a/lib/entrypoint.test-d.ts +++ b/lib/entrypoint.test-d.ts @@ -94,6 +94,9 @@ export type Entrypoint = { // decide options OptimizelyDecideOption: typeof OptimizelyDecideOption; + + // client engine + clientEngine: string; } diff --git a/lib/index.browser.ts b/lib/index.browser.ts index 8be972be3..b8c31659d 100644 --- a/lib/index.browser.ts +++ b/lib/index.browser.ts @@ -17,6 +17,7 @@ import { Config, Client } from './shared_types'; import sendBeaconEventDispatcher from './event_processor/event_dispatcher/send_beacon_dispatcher.browser'; import { getOptimizelyInstance } from './client_factory'; import { EventDispatcher } from './event_processor/event_dispatcher/event_dispatcher'; +import { JAVASCRIPT_CLIENT_ENGINE } from './utils/enums'; /** * Creates an instance of the Optimizely class @@ -55,3 +56,5 @@ export { createVuidManager } from './vuid/vuid_manager_factory.browser'; export * from './common_exports'; export * from './export_types'; + +export const clientEngine: string = JAVASCRIPT_CLIENT_ENGINE; diff --git a/lib/index.node.ts b/lib/index.node.ts index e39501e83..cb1802af8 100644 --- a/lib/index.node.ts +++ b/lib/index.node.ts @@ -48,3 +48,5 @@ export { createVuidManager } from './vuid/vuid_manager_factory.node'; export * from './common_exports'; export * from './export_types'; + +export const clientEngine: string = NODE_CLIENT_ENGINE; diff --git a/lib/index.react_native.ts b/lib/index.react_native.ts index 4cf20fccd..48a8ee35c 100644 --- a/lib/index.react_native.ts +++ b/lib/index.react_native.ts @@ -51,3 +51,5 @@ export { createVuidManager } from './vuid/vuid_manager_factory.react_native'; export * from './common_exports'; export * from './export_types'; + +export const clientEngine: string = REACT_NATIVE_JS_CLIENT_ENGINE;