From 5928e07509a362f0065305379a65adc1198bdd70 Mon Sep 17 00:00:00 2001 From: Devin Zuczek Date: Mon, 31 Aug 2026 23:43:13 -0400 Subject: [PATCH] [api] turn off statsig --- apps/api/src/openapi.ts | 8 +++++--- apps/api/src/routes/config.ts | 14 ++++++++------ apps/api/src/test/integration/api.test.ts | 8 +++++--- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/apps/api/src/openapi.ts b/apps/api/src/openapi.ts index 0bdb7ac..fbdfe6a 100644 --- a/apps/api/src/openapi.ts +++ b/apps/api/src/openapi.ts @@ -119,12 +119,14 @@ export const SuccessErrorEnvelope = z.object({ // ---- Config ---------------------------------------------------------------- -/** `GET /api/config/v1/amplitude` — analytics keys (all disabled on this server). */ +/** `GET /api/config/v1/amplitude` — the client's analytics keys (blank; RudderStack and StatSig off). */ export const AmplitudeConfig = z.object({ AmplitudeKey: z.string(), - StatSigKey: z.string(), - RudderStackKey: z.string(), UseRudderStack: z.boolean(), + RudderStackKey: z.string(), + UseStatSig: z.boolean(), + StatSigKey: z.string(), + StatSigEnvironment: z.number().int(), }) /** `GET /api/config/v1/azurespeech` — speech-to-text config; `Enabled` is false here. */ diff --git a/apps/api/src/routes/config.ts b/apps/api/src/routes/config.ts index d056a9a..795d17c 100644 --- a/apps/api/src/routes/config.ts +++ b/apps/api/src/routes/config.ts @@ -29,17 +29,19 @@ export const configRoutes = new Hono({ strict: false }) tags: ['Config'], summary: 'Analytics keys', description: - 'The Amplitude / StatSig / RudderStack keys the client initialises its analytics ' + - 'with. This server collects nothing, so the keys are placeholders and RudderStack ' + - 'is off — but the client needs the object to finish loading.', + 'The Amplitude / RudderStack / StatSig keys the client initialises its analytics ' + + 'with. This server collects nothing, so the keys are blank and RudderStack and ' + + 'StatSig are off — but the client needs the object to finish loading.', responses: { 200: json(AmplitudeConfig, 'Placeholder analytics keys') }, }), (c) => c.json({ - AmplitudeKey: 'a', - StatSigKey: 'a', - RudderStackKey: 'a', + AmplitudeKey: '', UseRudderStack: false, + RudderStackKey: '', + UseStatSig: false, + StatSigKey: '', + StatSigEnvironment: 0, }) ) .get( diff --git a/apps/api/src/test/integration/api.test.ts b/apps/api/src/test/integration/api.test.ts index 92a4cdc..6b59e51 100644 --- a/apps/api/src/test/integration/api.test.ts +++ b/apps/api/src/test/integration/api.test.ts @@ -213,10 +213,12 @@ describe('public endpoints', () => { const res = await exports.default.fetch(`${ORIGIN}/api/config/v1/amplitude`) expect(res.status).toBe(200) expect(await res.json()).toEqual({ - AmplitudeKey: 'a', - StatSigKey: 'a', - RudderStackKey: 'a', + AmplitudeKey: '', UseRudderStack: false, + RudderStackKey: '', + UseStatSig: false, + StatSigKey: '', + StatSigEnvironment: 0, }) })