Mocked analytics when no analytics api url

This commit is contained in:
DrMint 2024-07-13 14:16:28 +02:00
parent 989854957d
commit b558ecbfa1
1 changed files with 8 additions and 1 deletions

View File

@ -11,7 +11,14 @@ export const meilisearch = new MeilisearchSDK(
import.meta.env.MEILISEARCH_MASTER_KEY
);
export const analytics = new AnalyticsSDK(import.meta.env.ANALYTICS_URL);
const mockedAnalytics = {
trackRequest: () => {},
trackEvent: () => {},
};
export const analytics = import.meta.env.ANALYTICS_URL
? new AnalyticsSDK(import.meta.env.ANALYTICS_URL)
: mockedAnalytics;
const tokenCache = new TokenCache();