diff --git a/ppr-ui/src/plugins/init.ts b/ppr-ui/src/plugins/init.ts index 8d189e552..382c777e8 100644 --- a/ppr-ui/src/plugins/init.ts +++ b/ppr-ui/src/plugins/init.ts @@ -8,7 +8,7 @@ export default defineNuxtPlugin(async (nuxtApp) => { // initialize Launch Darkly if (useRuntimeConfig().public.VUE_APP_PPR_LD_CLIENT_ID) { console.info('Initializing Launch Darkly...') - await initLdClient() + await initLdClient(useRuntimeConfig().public.VUE_APP_PPR_LD_CLIENT_ID) } // Local development only diff --git a/ppr-ui/src/utils/config-helper.ts b/ppr-ui/src/utils/config-helper.ts index 44d6dfa87..72d750dcf 100644 --- a/ppr-ui/src/utils/config-helper.ts +++ b/ppr-ui/src/utils/config-helper.ts @@ -72,11 +72,6 @@ export async function fetchConfig (): Promise { sessionStorage.setItem('ACCOUNT_ID', accountId) } - const ldClientId: string = config.VUE_APP_PPR_LD_CLIENT_ID - if (ldClientId) { - (window).ldClientId = ldClientId - } - const pprStaffPartyCode: string = config.VUE_APP_PPR_STAFF_PARTY_CODE if (pprStaffPartyCode) { sessionStorage.setItem('PPR_STAFF_PARTY_CODE', pprStaffPartyCode) diff --git a/ppr-ui/src/utils/feature-flags.ts b/ppr-ui/src/utils/feature-flags.ts index 8ebe39c86..5609f28f9 100644 --- a/ppr-ui/src/utils/feature-flags.ts +++ b/ppr-ui/src/utils/feature-flags.ts @@ -1,4 +1,5 @@ -import { initialize, LDClient, LDFlagSet, LDOptions, LDUser } from 'launchdarkly-js-client-sdk' +import type { LDClient, LDFlagSet, LDOptions, LDUser } from 'launchdarkly-js-client-sdk'; +import { initialize } from 'launchdarkly-js-client-sdk' /** * Default feature flags in case LD env key is not defined (eg, local development). @@ -36,9 +37,7 @@ let ldClient: LDClient = null /** * An async method that initializes the Launch Darkly client. */ -export async function initLdClient (): Promise { - const envKey: string = window['ldClientId'] // eslint-disable-line dot-notation - +export async function initLdClient (envKey: string): Promise { if (envKey) { const user: LDUser = { // since we have no user data yet, use a shared key temporarily