1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-09-03 14:22:41 +02:00

feat: add roadmap key

This commit is contained in:
Arik Chakma
2025-09-02 00:55:12 +06:00
committed by Kamran Ahmed
parent 8dbe1468ed
commit e2075529ac
2 changed files with 10 additions and 2 deletions

View File

@@ -7,4 +7,6 @@ PUBLIC_STRIPE_INDIVIDUAL_MONTHLY_PRICE_ID=
PUBLIC_STRIPE_INDIVIDUAL_YEARLY_PRICE_ID= PUBLIC_STRIPE_INDIVIDUAL_YEARLY_PRICE_ID=
PUBLIC_STRIPE_INDIVIDUAL_MONTHLY_PRICE_AMOUNT=10 PUBLIC_STRIPE_INDIVIDUAL_MONTHLY_PRICE_AMOUNT=10
PUBLIC_STRIPE_INDIVIDUAL_YEARLY_PRICE_AMOUNT=100 PUBLIC_STRIPE_INDIVIDUAL_YEARLY_PRICE_AMOUNT=100
ROADMAP_KEY=

View File

@@ -44,7 +44,9 @@ export async function httpCall<ResponseType = AppResponse>(
: `${import.meta.env.PUBLIC_API_URL}${url}`; : `${import.meta.env.PUBLIC_API_URL}${url}`;
try { try {
let visitorId = ''; let visitorId = '';
if (typeof window !== 'undefined') {
const isServer = typeof window === 'undefined';
if (!isServer) {
const fingerprintPromise = await fp.load(); const fingerprintPromise = await fp.load();
const fingerprint = await fingerprintPromise.get(); const fingerprint = await fingerprintPromise.get();
visitorId = fingerprint.visitorId; visitorId = fingerprint.visitorId;
@@ -59,6 +61,10 @@ export async function httpCall<ResponseType = AppResponse>(
...(options?.headers ?? {}), ...(options?.headers ?? {}),
}); });
if (isServer) {
headers.set('Roadmap-Key', import.meta.env.ROADMAP_KEY);
}
if (!isMultiPartFormData) { if (!isMultiPartFormData) {
headers.set('Content-Type', 'application/json'); headers.set('Content-Type', 'application/json');
} }