diff --git a/.env.example b/.env.example index 9bb481b2b..9472fe0b6 100644 --- a/.env.example +++ b/.env.example @@ -7,4 +7,6 @@ PUBLIC_STRIPE_INDIVIDUAL_MONTHLY_PRICE_ID= PUBLIC_STRIPE_INDIVIDUAL_YEARLY_PRICE_ID= PUBLIC_STRIPE_INDIVIDUAL_MONTHLY_PRICE_AMOUNT=10 -PUBLIC_STRIPE_INDIVIDUAL_YEARLY_PRICE_AMOUNT=100 \ No newline at end of file +PUBLIC_STRIPE_INDIVIDUAL_YEARLY_PRICE_AMOUNT=100 + +ROADMAP_KEY= \ No newline at end of file diff --git a/src/lib/query-http.ts b/src/lib/query-http.ts index 38b47f622..8dc8d9609 100644 --- a/src/lib/query-http.ts +++ b/src/lib/query-http.ts @@ -44,7 +44,9 @@ export async function httpCall( : `${import.meta.env.PUBLIC_API_URL}${url}`; try { let visitorId = ''; - if (typeof window !== 'undefined') { + + const isServer = typeof window === 'undefined'; + if (!isServer) { const fingerprintPromise = await fp.load(); const fingerprint = await fingerprintPromise.get(); visitorId = fingerprint.visitorId; @@ -59,6 +61,10 @@ export async function httpCall( ...(options?.headers ?? {}), }); + if (isServer) { + headers.set('Roadmap-Key', import.meta.env.ROADMAP_KEY); + } + if (!isMultiPartFormData) { headers.set('Content-Type', 'application/json'); }