This commit is contained in:
2026-05-23 17:17:56 -07:00
commit 448f2e33ef
135 changed files with 11817 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
declare global {
interface Window {
umami?: {
track: (name: string, data?: Record<string, any>) => Promise<void>
identify: (id: string, data?: Record<string, any>) => Promise<void>
}
}
}
export function wtEvent(eventName: string, data?: Record<string, any>) {
console.log('[WATCHTOWER] Event:', eventName, data)
window.umami?.track(eventName, data).catch((error) => {
console.error('[WatchTower] Event Failed:', { eventName, data }, error)
})
}
// // Do not use, this goes against the privacy policy!
// export function wtIdentify(who: string | number, data?: object) {
// console.log('[WATCHTOWER] Identify:', who, data)
// window.umami?.identify(String(who), data).catch((error) => {
// console.error('[WatchTower] Identify Failed:', { who, data }, error)
// })
// }
// Not yet in service!
// if (import.meta.env.PROD) {
// const script = document.createElement('script')
// script.defer = true
// script.src = 'https://watchtower.pancakz.net/script.js'
// script.dataset.websiteId = '...'
// document.body.appendChild(script)
// }