Strip down the entire project
This commit is contained in:
parent
a0a02458b0
commit
7416341746
95 changed files with 647 additions and 43115 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue