mirror of
https://github.com/hanzoai/analytics.git
synced 2026-10-30 15:05:29 +00:00
- Rename src/lib/clickhouse.ts → src/lib/datastore.ts - Rename collector/writer/clickhouse.go → collector/writer/datastore.go - Replace CLICKHOUSE_URL env var with DATASTORE_URL across all files - Update all 45+ query files: imports, constants, function names - Update collector Go service to use DATASTORE_URL/DATASTORE_DSN - Alias Go driver import as `ds` to remove clickhouse naming - Add unified third-party analytics to tracker script: Google Analytics (data-ga-id), Facebook Pixel (data-fb-pixel-id), TikTok Pixel (data-tt-pixel-id), GTM (data-gtm-id), LinkedIn (data-linkedin-id), Pinterest (data-pinterest-id), Snapchat (data-snap-pixel-id), Plausible (data-plausible-domain) - Single script tag, zero config — all providers auto-forward page views and custom events alongside Hanzo Analytics collection
28 lines
606 B
JavaScript
28 lines
606 B
JavaScript
/* eslint-disable no-console */
|
|
import 'dotenv/config';
|
|
|
|
function checkMissing(vars) {
|
|
const missing = vars.reduce((arr, key) => {
|
|
if (!process.env[key]) {
|
|
arr.push(key);
|
|
}
|
|
return arr;
|
|
}, []);
|
|
|
|
if (missing.length) {
|
|
console.log(`The following environment variables are not defined:`);
|
|
for (const item of missing) {
|
|
console.log(' - ', item);
|
|
}
|
|
process.exit(1);
|
|
}
|
|
}
|
|
|
|
if (!process.env.SKIP_DB_CHECK && !process.env.DATABASE_TYPE) {
|
|
checkMissing(['DATABASE_URL']);
|
|
}
|
|
|
|
if (process.env.CLOUD_URL) {
|
|
checkMissing(['CLOUD_URL', 'DATASTORE_URL', 'REDIS_URL']);
|
|
}
|