Strip down the entire project

This commit is contained in:
Korbs 2025-02-18 20:19:12 -05:00
parent a0a02458b0
commit 7416341746
Signed by: Korbs
SSH key fingerprint: SHA256:Q0b0KraMldpAO9oKa+w+gcsXsOTykQ4UkAKn0ByGn5U
95 changed files with 647 additions and 43115 deletions

View file

@ -1,16 +1,16 @@
let defaultLocale: string | undefined;
let defaultIsDebug: boolean | undefined;
const isInBrowser = typeof window !== 'undefined' && typeof window.fetch !== 'undefined';
const isInBrowserExtension = typeof chrome !== 'undefined' && !!chrome.runtime?.id;
const isInBrowser = true;
let _sessionId = newSessionId();
let _lastTouched = new Date();
const _hosts: { [region: string]: string } = {
US: 'https://us.aptabase.com',
EU: 'https://eu.aptabase.com',
DEV: 'https://localhost:3000',
SH: '',
US: 'https://us.aptabase.com', // Operated by Aptabase in North America
EU: 'https://eu.aptabase.com', // Operated by Aptabase in Europe
SV: 'https://events.sudovanilla.org', // Owned and operated by SudoVanilla in North America
DEV: 'https://localhost:3000', // Local Development
SH: '', // Selfhost
};
export type AptabaseOptions = {
@ -80,7 +80,7 @@ export async function sendEvent(opts: {
eventName: string;
props?: Record<string, string | number | boolean>;
}): Promise<void> {
if (!isInBrowser && !isInBrowserExtension) {
if (!isInBrowser) {
console.warn(`Aptabase: trackEvent requires a browser environment. Event "${opts.eventName}" will be discarded.`);
return;
}