diff --git a/src/lib/__snapshots__/create-config.test.ts.snap b/src/lib/__snapshots__/create-config.test.ts.snap index f0f3bf4187..f232782994 100644 --- a/src/lib/__snapshots__/create-config.test.ts.snap +++ b/src/lib/__snapshots__/create-config.test.ts.snap @@ -71,6 +71,7 @@ exports[`should create default config 1`] = ` "anonymiseEventLog": false, "bulkOperations": false, "caseInsensitiveInOperators": false, + "cleanClientApi": false, "crOnVariants": false, "embedProxy": true, "embedProxyFrontend": true, @@ -95,6 +96,7 @@ exports[`should create default config 1`] = ` "anonymiseEventLog": false, "bulkOperations": false, "caseInsensitiveInOperators": false, + "cleanClientApi": false, "crOnVariants": false, "embedProxy": true, "embedProxyFrontend": true, diff --git a/src/lib/services/feature-toggle-service.ts b/src/lib/services/feature-toggle-service.ts index b99346d2ea..5eddd6d76d 100644 --- a/src/lib/services/feature-toggle-service.ts +++ b/src/lib/services/feature-toggle-service.ts @@ -692,33 +692,37 @@ class FeatureToggleService { query, includeIds, ); - return result.map( - ({ - name, - type, - enabled, - project, - stale, - strategies, - variants, - description, - createdAt, - lastSeenAt, - impressionData, - }) => ({ - name, - type, - enabled, - project, - stale, - strategies, - variants, - description, - createdAt, - lastSeenAt, - impressionData, - }), - ); + if (this.flagResolver.isEnabled('cleanClientApi')) { + return result.map( + ({ + name, + type, + enabled, + project, + stale, + strategies, + variants, + description, + createdAt, + lastSeenAt, + impressionData, + }) => ({ + name, + type, + enabled, + project, + stale, + strategies, + variants, + description, + createdAt, + lastSeenAt, + impressionData, + }), + ); + } else { + return result; + } } /** diff --git a/src/lib/types/experimental.ts b/src/lib/types/experimental.ts index 5f7bff67b7..6abc207cb9 100644 --- a/src/lib/types/experimental.ts +++ b/src/lib/types/experimental.ts @@ -72,6 +72,7 @@ const flags = { process.env.PROJECT_SCOPED_SEGMENTS, false, ), + cleanClientApi: parseEnvVarBoolean(process.env.CLEAN_CLIENT_API, false), }; export const defaultExperimentalOptions: IExperimentalOptions = {