Skip to content

🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.

Lite dashboard 2 (#1011)

Goldflag519a65555f7c
diff --git a/client/Dockerfile b/client/Dockerfile
index f67932579..1eba67dd5 100644
--- a/client/Dockerfile
+++ b/client/Dockerfile
@@ -30,11 +30,14 @@ ARG NEXT_PUBLIC_DISABLE_SIGNUP
ARG NEXT_PUBLIC_CLOUD
ARG NEXT_PUBLIC_TURNSTILE_SITE_KEY
ARG NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY
+ARG NEXT_PUBLIC_LITE_DASHBOARD
ENV NEXT_PUBLIC_BACKEND_URL=${NEXT_PUBLIC_BACKEND_URL}
ENV NEXT_PUBLIC_DISABLE_SIGNUP=${NEXT_PUBLIC_DISABLE_SIGNUP}
ENV NEXT_PUBLIC_CLOUD=${NEXT_PUBLIC_CLOUD}
ENV NEXT_PUBLIC_TURNSTILE_SITE_KEY=${NEXT_PUBLIC_TURNSTILE_SITE_KEY}
ENV NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=${NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY}
+ENV NEXT_PUBLIC_DEPLOYMENT=${NEXT_PUBLIC_DEPLOYMENT}
+ENV NEXT_PUBLIC_LITE_DASHBOARD=${NEXT_PUBLIC_LITE_DASHBOARD}
WORKDIR /app/client
RUN npm run build
diff --git a/client/messages/cs.json b/client/messages/cs.json
index 8ea71d5c0..780da24ae 100644
--- a/client/messages/cs.json
+++ b/client/messages/cs.json
@@ -66,6 +66,7 @@
"tL4WC1": "Načítám další...",
"HPx76n": "Všechny položky načteny",
"QkTyho": "Postranní panel Rybbit",
+ "erYzJH": "",
"bnhHP6": "Webová analytika",
"EFTSMc": "Hlavní",
"EYNe7E": "Globus",
@@ -87,7 +88,7 @@
"D3idYv": "Nastavení",
"yMG/h7": "Nastavení webu",
"yBqtD8": "{count} relací (24h)",
- "MzI/h2": "Přidat web",
+ "FIKvUB": "",
"Yxwqz8": "Žádný web nevybrán",
"Gpwv5L": "PDF report stažen",
"zJPmwX": "Nepodařilo se vygenerovat PDF report",
@@ -328,10 +329,10 @@
"Lu6+QS": "",
"qdOqu/": "",
"tGuKrF": "",
- "W6nwjo": "Koncept",
"LHF3Za": "",
- "47FYwb": "Zrušit",
+ "W6nwjo": "Koncept",
"rbrahO": "Zavřít",
+ "47FYwb": "Zrušit",
"cyR7Kh": "",
"TiR/Hq": "Ukládám...",
"mRL9Vh": "Vytvářím...",
@@ -354,8 +355,8 @@
"l94vPo": "",
"qQTwNl": "",
"IuPATc": "",
- "W1QsrY": "",
"UBQJK/": "",
+ "W1QsrY": "",
"4IJvOg": "",
"iHip8n": "",
"kNp7lL": "",
@@ -593,6 +594,7 @@
"nGQuNF": "Stránek na relaci",
"yunf47": "Doba trvání relace",
"MnpyfA": "Unikátní uživatelé",
+ "kgLyso": "",
"RumeRz": "Regiony",
"IFkDw5": "Města",
"GsBRWL": "Jazyky",
@@ -831,17 +833,21 @@
"rDEYPT": "Vyber organizaci, ze které chceš odebrat {email}. Ztratí přístup ke všem zdrojům v dané organizaci.",
"3Vr8ps": "Administrátorský panel",
"KI5ndC": "Neplatný formát domény. Musí být platná doména jako example.com nebo sub.example.com",
+ "KI57sV": "",
"cGNlRB": "Upgraduj na Pro pro přidání více webů",
"UpxSPM": "Pro přidání webů musíš mít aktivní předplatné",
"Ymfrjv": "Dosáhl jsi limitu {limit} webů. Upgraduj pro přidání dalších webů",
- "m5aC6r": "Sleduj analytiku nového webu ve své organizaci",
+ "AZEGID": "",
+ "JkLHGw": "",
+ "CXI0EW": "",
"oAFgOq": "Doména",
+ "VQxsRK": "",
"3ARIAn": "Zobrazovaný název (výchozí je doména)",
"fcj5H7": "Veřejná analytika",
"qQ21OF": "Když je zapnuto, kdokoli může zobrazit analytiku bez přihlášení",
"u/sVSP": "Zapnout solení ID uživatelů",
"yGxRRq": "Zvýšení soukromí pomocí denně rotujících solí pro ID uživatelů",
- "9ozcJb": "Chyba při přidávání webu",
+ "W35dz6": "",
"u6kSOz": "Líbí se ti Rybbit? Zvaž sponzorování projektu!",
"IDklh3": "Sponzoruj nás",
"c/KktL": "Zdroje",
@@ -888,6 +894,7 @@
"97KPX7": "Žádné štítky nenalezeny.",
"8Nc/jD": "Zatím žádné weby",
"nhaiN+": "Přidej svůj první web a začni sledovat analytiku",
+ "MzI/h2": "Přidat web",
"/dxF+k": "Heslo musí mít alespoň 8 znaků",
"6bxWvN": "Heslo úspěšně obnoveno",
"yAAjri": "Zadej OTP kód",
@@ -1294,7 +1301,9 @@
"dcLGy5": "",
"Eq9gxg": "",
"l3J5rs": "",
+ "2YpSsF": "",
"VKppxp": "Doména nemůže být prázdná",
+ "HtTwhf": "",
"69jzMr": "Doména úspěšně aktualizována",
"gwATc0": "Nepodařilo se aktualizovat doménu",
"mNRvgY": "Web úspěšně smazán",
@@ -1316,6 +1325,7 @@
"lnIbba": "Sledování IP adresy vypnuto",
"DQO/Q8": "Název webu",
"7IM0G6": "Zobrazovaný název tohoto webu",
+ "zoRFJV": "",
"I7l2wK": "Doména používaná pro sledování",
"asd4Px": "Soukromí a zabezpečení",
"gI1OXG": "Smazat web",
@@ -1370,6 +1380,8 @@
"biJyKp": "Vyloučení provozu z konkrétních IP adres nebo rozsahů. Podporuje jednotlivé IP (192.168.1.1), CIDR notaci (192.168.1.0/24) a rozsahy (192.168.1.1-192.168.1.10).",
"tH8S0d": "Přidat IP",
"pTHVrx": "Maximálně 100 IP výjimek povoleno",
+ "pm+3nT": "",
+ "0Q1jqR": "",
"WFlQVv": "Sledovací skript",
"EGPr1w": "Přidej tento skript do {headTag} svého webu",
"NPL5hM": "Vzory přeskočení",
@@ -1405,7 +1417,9 @@
"YluXPL": "Zahrnout parametry URL do sledování stránek",
"kehGIT": "Sledování URL parametrů zapnuto",
"LIX+6S": "Sledování URL parametrů vypnuto",
+ "8s+sTd": "",
"fWblDI": "Úvodní zobrazení stránky",
+ "495/Ut": "",
"ciDaNU": "Automaticky zaznamenat první zobrazení stránky při načtení skriptu",
"KzO2sB": "Sledování úvodního zobrazení stránky zapnuto",
"FcSY6x": "Sledování úvodního zobrazení stránky vypnuto",
@@ -1413,6 +1427,7 @@
"mFg4Ag": "Sledování odchozích odkazů zapnuto",
"sbjdWu": "Sledování odchozích odkazů vypnuto",
"5zGub0": "Sledování chyb",
+ "lxHUeO": "",
"4nfQk6": "Zachytávej JavaScript chyby a výjimky z tvého webu",
"7LjSrf": "Sledování chyb vypnuto",
"u013P/": "Automaticky sleduj kliknutí na všechna tlačítka",
diff --git a/client/messages/de.json b/client/messages/de.json
index 9aa324f67..44fc80f89 100644
--- a/client/messages/de.json
+++ b/client/messages/de.json
@@ -66,12 +66,13 @@
"tL4WC1": "Lade mehr...",
"HPx76n": "Alle Einträge geladen",
"QkTyho": "Rybbit-Seitenleiste",
+ "erYzJH": "",
"bnhHP6": "Webanalyse",
"EFTSMc": "Übersicht",
"EYNe7E": "Globus",
"CxfKLC": "Seiten",
"AA5h7P": "Leistung",
- "LlNItA": "Bots",
+ "LlNItA": "",
"XHLYdJ": "Ziele",
"9d/EEp": "Produktanalyse",
"5yUsUe": "Wiedergabe",
@@ -87,7 +88,7 @@
"D3idYv": "Einstellungen",
"yMG/h7": "Website-Einstellungen",
"yBqtD8": "{count} Sitzungen (24h)",
- "MzI/h2": "Website hinzufügen",
+ "FIKvUB": "",
"Yxwqz8": "Keine Website ausgewählt",
"Gpwv5L": "PDF-Bericht heruntergeladen",
"zJPmwX": "PDF-Bericht konnte nicht erstellt werden",
@@ -328,10 +329,10 @@
"Lu6+QS": "",
"qdOqu/": "",
"tGuKrF": "",
- "W6nwjo": "Entwurf",
"LHF3Za": "",
- "47FYwb": "Abbrechen",
+ "W6nwjo": "Entwurf",
"rbrahO": "Schließen",
+ "47FYwb": "Abbrechen",
"cyR7Kh": "",
"TiR/Hq": "Wird gespeichert...",
"mRL9Vh": "Wird erstellt...",
@@ -354,8 +355,8 @@
"l94vPo": "",
"qQTwNl": "",
"IuPATc": "",
- "W1QsrY": "",
"UBQJK/": "",
+ "W1QsrY": "",
"4IJvOg": "",
"iHip8n": "",
"kNp7lL": "",
@@ -593,6 +594,7 @@
"nGQuNF": "Seiten pro Sitzung",
"yunf47": "Sitzungsdauer",
"MnpyfA": "Eindeutige Benutzer",
+ "kgLyso": "",
"RumeRz": "Regionen",
"IFkDw5": "Städte",
"GsBRWL": "Sprachen",
@@ -831,17 +833,21 @@
"rDEYPT": "Wählen Sie die Organisation, aus der {email} entfernt werden soll. Der Zugriff auf alle Ressourcen dieser Organisation geht verloren.",
"3Vr8ps": "Admin-Dashboard",
"KI5ndC": "Ungültiges Domainformat. Muss eine gültige Domain wie beispiel.de oder sub.beispiel.de sein",
+ "KI57sV": "",
"cGNlRB": "Upgrade auf Pro, um weitere Websites hinzuzufügen",
"UpxSPM": "Sie benötigen ein aktives Abonnement, um Websites hinzuzufügen",
"Ymfrjv": "Sie haben das Limit von {limit} Websites erreicht. Upgraden Sie, um weitere hinzuzufügen",
- "m5aC6r": "Verfolgen Sie Analysen für eine neue Website in Ihrer Organisation",
+ "AZEGID": "",
+ "JkLHGw": "",
+ "CXI0EW": "",
"oAFgOq": "Domain",
+ "VQxsRK": "",
"3ARIAn": "Anzeigename (Standard ist Domain)",
"fcj5H7": "Öffentliche Analysen",
"qQ21OF": "Wenn aktiviert, kann jeder die Analysen ohne Anmeldung einsehen",
"u/sVSP": "Benutzer-ID-Salting aktivieren",
"yGxRRq": "Verbessern Sie den Datenschutz mit täglich rotierenden Salts für Benutzer-IDs",
- "9ozcJb": "Fehler beim Hinzufügen der Website",
+ "W35dz6": "",
"u6kSOz": "Gefällt Ihnen Rybbit? Erwägen Sie, das Projekt zu sponsern!",
"IDklh3": "Sponsern Sie uns",
"c/KktL": "Ressourcen",
@@ -888,6 +894,7 @@
"97KPX7": "Keine Tags gefunden.",
"8Nc/jD": "Noch keine Websites",
"nhaiN+": "Fügen Sie Ihre erste Website hinzu, um mit der Analyse zu beginnen",
+ "MzI/h2": "Website hinzufügen",
"/dxF+k": "Das Passwort muss mindestens 8 Zeichen lang sein",
"6bxWvN": "Passwort erfolgreich zurückgesetzt",
"yAAjri": "OTP-Code eingeben",
@@ -1255,24 +1262,24 @@
"f3ocee": "Schließen Sie Traffic aus bestimmten Ländern aus. Events aus diesen Ländern werden nicht in Ihren Analysen erfasst.",
"ItR6u3": "Ausgeschlossene Länder ({count})",
"jm/spn": "Zurücksetzen",
- "+CwN9C": "System",
- "dmW5bt": "Öffnen Sie die URL der privaten Dashboard-Einbettung in einem neuen Tab.",
- "PkGCG1": "Generieren Sie einen privaten Link, um die Dashboard-Einbettung auszuprobieren.",
- "UcHF+A": "Privater Link generiert",
- "6NIu/x": "Privaten Link konnte nicht generiert werden",
+ "+CwN9C": "",
+ "dmW5bt": "",
+ "PkGCG1": "",
+ "UcHF+A": "",
+ "6NIu/x": "",
"mBCW/X": "Dashboard-Einbettung",
- "QRvU5C": "Binden Sie das Haupt-Analyse-Dashboard mit einem privaten Link auf einer anderen Website ein.",
- "Ygzo5N": "Privater Link",
- "KOXkeN": "Dashboard-Einbettungen erfordern einen privaten Link. Jeder mit der iframe-URL kann das schreibgeschützte Dashboard anzeigen.",
- "PRAz+o": "Privater Link aktiviert",
+ "QRvU5C": "",
+ "Ygzo5N": "",
+ "KOXkeN": "",
+ "PRAz+o": "",
"Pe0ogR": "Design",
- "WNF1J6": "Wählen Sie aus, wie das eingebettete Dashboard angezeigt wird.",
+ "WNF1J6": "",
"FsIP28": "Seitenleiste ausblenden",
"dZAp5K": "Über diese Einbettung ist nur die Hauptdashboard-Seite sichtbar.",
- "oJEVob": "Ausprobieren",
+ "oJEVob": "",
"JfG49w": "Offen",
"TJo5E6": "Vorschau",
- "0uO8I3": "Privaten Link zur Vorschau generieren",
+ "0uO8I3": "",
"CHzo7t": "Einbettungscode",
"m4+mLq": "Letzte 30 Minuten",
"8O9cAb": "Letzte 24 Stunden",
@@ -1294,7 +1301,9 @@
"dcLGy5": "Zeigt die Top 5 Länder an, die Ihre Website besuchen.",
"Eq9gxg": "Breite (px)",
"l3J5rs": "Iframe-Breite. Verwenden Sie max-width: 100% für responsive Layouts.",
+ "2YpSsF": "",
"VKppxp": "Domain darf nicht leer sein",
+ "HtTwhf": "",
"69jzMr": "Domain erfolgreich aktualisiert",
"gwATc0": "Domain konnte nicht aktualisiert werden",
"mNRvgY": "Website erfolgreich gelöscht",
@@ -1316,6 +1325,7 @@
"lnIbba": "IP-Adress-Tracking deaktiviert",
"DQO/Q8": "Website-Name",
"7IM0G6": "Der Anzeigename für diese Website",
+ "zoRFJV": "",
"I7l2wK": "Die für das Tracking verwendete Domain",
"asd4Px": "Datenschutz & Sicherheit",
"gI1OXG": "Website löschen",
@@ -1370,6 +1380,8 @@
"biJyKp": "Schließen Sie Traffic von bestimmten IP-Adressen oder -Bereichen aus. Unterstützt einzelne IPs (192.168.1.1), CIDR-Notation (192.168.1.0/24) und Bereiche (192.168.1.1-192.168.1.10).",
"tH8S0d": "IP hinzufügen",
"pTHVrx": "Maximal 100 IP-Ausschlüsse erlaubt",
+ "pm+3nT": "",
+ "0Q1jqR": "",
"WFlQVv": "Tracking-Skript",
"EGPr1w": "Fügen Sie dieses Skript zum {headTag} Ihrer Website hinzu",
"NPL5hM": "Ausschlussmuster",
@@ -1405,7 +1417,9 @@
"YluXPL": "Abfrageparameter im Seiten-Tracking einbeziehen",
"kehGIT": "URL-Parameter-Tracking aktiviert",
"LIX+6S": "URL-Parameter-Tracking deaktiviert",
+ "8s+sTd": "",
"fWblDI": "Erster Seitenaufruf",
+ "495/Ut": "",
"ciDaNU": "Automatisch den ersten Seitenaufruf beim Laden des Skripts erfassen",
"KzO2sB": "Tracking des ersten Seitenaufrufs aktiviert",
"FcSY6x": "Tracking des ersten Seitenaufrufs deaktiviert",
@@ -1413,6 +1427,7 @@
"mFg4Ag": "Ausgehendes Tracking aktiviert",
"sbjdWu": "Ausgehendes Tracking deaktiviert",
"5zGub0": "Fehlerverfolgung",
+ "lxHUeO": "",
"4nfQk6": "JavaScript-Fehler und Ausnahmen von Ihrer Website erfassen",
"7LjSrf": "Fehlerverfolgung deaktiviert",
"u013P/": "Automatisch Klicks auf alle Buttons verfolgen",
diff --git a/client/messages/en.json b/client/messages/en.json
index 714adce97..115399436 100644
--- a/client/messages/en.json
+++ b/client/messages/en.json
@@ -66,6 +66,7 @@
"tL4WC1": "Loading more...",
"HPx76n": "All items loaded",
"QkTyho": "Rybbit Sidebar",
+ "erYzJH": "App Analytics",
"bnhHP6": "Web Analytics",
"EFTSMc": "Main",
"EYNe7E": "Globe",
@@ -87,7 +88,7 @@
"D3idYv": "Settings",
"yMG/h7": "Site Settings",
"yBqtD8": "{count} sessions (24h)",
- "MzI/h2": "Add Website",
+ "FIKvUB": "Add Site",
"Yxwqz8": "No site selected",
"Gpwv5L": "PDF report downloaded",
"zJPmwX": "Failed to generate PDF report",
@@ -328,10 +329,10 @@
"Lu6+QS": "Edit experiment",
"qdOqu/": "Create experiment",
"tGuKrF": "New experiment",
- "W6nwjo": "Draft",
"LHF3Za": "Existing",
- "47FYwb": "Cancel",
+ "W6nwjo": "Draft",
"rbrahO": "Close",
+ "47FYwb": "Cancel",
"cyR7Kh": "Back",
"TiR/Hq": "Saving...",
"mRL9Vh": "Creating...",
@@ -354,8 +355,8 @@
"l94vPo": "{confidence}% confidence",
"qQTwNl": "Not yet significant",
"IuPATc": "Showing assigned visitors. Call rybbit.flag(\"{flagKey}\") where the variant renders to measure visitors actually exposed to it.",
- "W1QsrY": "No goal",
"UBQJK/": "Untitled goal",
+ "W1QsrY": "No goal",
"4IJvOg": "Ended {time}",
"iHip8n": "Started {time}",
"kNp7lL": "Created {time}",
@@ -593,6 +594,7 @@
"nGQuNF": "Pages per Session",
"yunf47": "Session Duration",
"MnpyfA": "Unique Users",
+ "kgLyso": "Total Time",
"RumeRz": "Regions",
"IFkDw5": "Cities",
"GsBRWL": "Languages",
@@ -831,17 +833,21 @@
"rDEYPT": "Select the organization to remove {email} from. They will lose access to all resources in that organization.",
"3Vr8ps": "Admin Dashboard",
"KI5ndC": "Invalid domain format. Must be a valid domain like example.com or sub.example.com",
+ "KI57sV": "Invalid app identifier. Use a bundle/package identifier like com.example.app",
"cGNlRB": "Upgrade to Pro to add more websites",
"UpxSPM": "You need to be on an active subscription to add websites",
"Ymfrjv": "You have reached the limit of {limit} websites. Upgrade to add more websites",
- "m5aC6r": "Track analytics for a new website in your organization",
+ "AZEGID": "Track analytics for a new website or React Native app in your organization",
+ "JkLHGw": "Website",
+ "CXI0EW": "React Native App",
"oAFgOq": "Domain",
+ "VQxsRK": "App Identifier",
"3ARIAn": "Display name (defaults to domain)",
"fcj5H7": "Public Analytics",
"qQ21OF": "When enabled, anyone can view analytics without logging in",
"u/sVSP": "Enable User ID Salting",
"yGxRRq": "Enhance privacy with daily rotating salts for user IDs",
- "9ozcJb": "Error Adding Website",
+ "W35dz6": "Error Adding Site",
"u6kSOz": "Liking Rybbit? Consider sponsoring the project!",
"IDklh3": "Sponsor us",
"c/KktL": "Resources",
@@ -888,6 +894,7 @@
"97KPX7": "No tags found.",
"8Nc/jD": "No websites yet",
"nhaiN+": "Add your first website to start tracking analytics",
+ "MzI/h2": "Add Website",
"/dxF+k": "Password must be at least 8 characters long",
"6bxWvN": "Password Reset Successful",
"yAAjri": "Enter OTP Code",
@@ -1294,7 +1301,9 @@
"dcLGy5": "Display the top 5 countries visiting your site.",
"Eq9gxg": "Width (px)",
"l3J5rs": "Iframe width. Use max-width: 100% for responsive layouts.",
+ "2YpSsF": "App identifier cannot be empty",
"VKppxp": "Domain cannot be empty",
+ "HtTwhf": "App identifier updated successfully",
"69jzMr": "Domain updated successfully",
"gwATc0": "Failed to update domain",
"mNRvgY": "Site deleted successfully",
@@ -1316,6 +1325,7 @@
"lnIbba": "IP address tracking disabled",
"DQO/Q8": "Site Name",
"7IM0G6": "The display name for this site",
+ "zoRFJV": "The bundle or package identifier used for tracking",
"I7l2wK": "The domain used for tracking",
"asd4Px": "Privacy & Security",
"gI1OXG": "Delete Site",
@@ -1370,6 +1380,8 @@
"biJyKp": "Exclude traffic from specific IP addresses or ranges. Supports single IPs (192.168.1.1), CIDR notation (192.168.1.0/24), and ranges (192.168.1.1-192.168.1.10).",
"tH8S0d": "Add IP",
"pTHVrx": "Maximum 100 IP exclusions allowed",
+ "pm+3nT": "React Native SDK",
+ "0Q1jqR": "Install the React Native package and initialize it in your app entry point",
"WFlQVv": "Tracking Script",
"EGPr1w": "Add this script to the {headTag} of your website",
"NPL5hM": "Skip Patterns",
@@ -1405,7 +1417,9 @@
"YluXPL": "Include query string parameters in page tracking",
"kehGIT": "URL parameters tracking enabled",
"LIX+6S": "URL parameters tracking disabled",
+ "8s+sTd": "Initial Screen View",
"fWblDI": "Initial Page View",
+ "495/Ut": "Automatically track the initial screen passed to the React Native SDK",
"ciDaNU": "Automatically track the first page view when the script loads",
"KzO2sB": "Initial page view tracking enabled",
"FcSY6x": "Initial page view tracking disabled",
@@ -1413,6 +1427,7 @@
"mFg4Ag": "Outbound tracking enabled",
"sbjdWu": "Outbound tracking disabled",
"5zGub0": "Error Tracking",
+ "lxHUeO": "Allow error events sent by the React Native SDK",
"4nfQk6": "Capture JavaScript errors and exceptions from your site",
"7LjSrf": "Error tracking disabled",
"u013P/": "Automatically track clicks on all buttons",
diff --git a/client/messages/es.json b/client/messages/es.json
index cf6551fd0..491eee115 100644
--- a/client/messages/es.json
+++ b/client/messages/es.json
@@ -66,12 +66,13 @@
"tL4WC1": "Cargando más...",
"HPx76n": "Todos los elementos cargados",
"QkTyho": "Barra lateral de Rybbit",
+ "erYzJH": "",
"bnhHP6": "Analíticas Web",
"EFTSMc": "Principal",
"EYNe7E": "Globo",
"CxfKLC": "Páginas",
"AA5h7P": "Rendimiento",
- "LlNItA": "Bots",
+ "LlNItA": "",
"XHLYdJ": "Objetivos",
"9d/EEp": "Analíticas de Producto",
"5yUsUe": "Repetición",
@@ -87,7 +88,7 @@
"D3idYv": "Configuraciones",
"yMG/h7": "Configuración del sitio",
"yBqtD8": "{count} sesiones (24h)",
- "MzI/h2": "Añadir sitio web",
+ "FIKvUB": "",
"Yxwqz8": "Ningún sitio seleccionado",
"Gpwv5L": "Informe PDF descargado",
"zJPmwX": "Error al generar informe PDF",
@@ -328,10 +329,10 @@
"Lu6+QS": "",
"qdOqu/": "",
"tGuKrF": "",
- "W6nwjo": "Borrador",
"LHF3Za": "",
- "47FYwb": "Cancelar",
+ "W6nwjo": "Borrador",
"rbrahO": "Cerrar",
+ "47FYwb": "Cancelar",
"cyR7Kh": "",
"TiR/Hq": "Guardando...",
"mRL9Vh": "Creando...",
@@ -354,8 +355,8 @@
"l94vPo": "",
"qQTwNl": "",
"IuPATc": "",
- "W1QsrY": "",
"UBQJK/": "",
+ "W1QsrY": "",
"4IJvOg": "",
"iHip8n": "",
"kNp7lL": "",
@@ -593,6 +594,7 @@
"nGQuNF": "Páginas por sesión",
"yunf47": "Duración de la sesión",
"MnpyfA": "Usuarios únicos",
+ "kgLyso": "",
"RumeRz": "Regiones",
"IFkDw5": "Ciudades",
"GsBRWL": "Idiomas",
@@ -831,17 +833,21 @@
"rDEYPT": "Selecciona la organización de la que eliminar a {email}. Perderán acceso a todos los recursos en esa organización.",
"3Vr8ps": "Panel de administración",
"KI5ndC": "Formato de dominio no válido. Debe ser un dominio válido como example.com o sub.example.com",
+ "KI57sV": "",
"cGNlRB": "Actualiza a Pro para añadir más sitios web",
"UpxSPM": "Necesitas tener una suscripción activa para añadir sitios web",
"Ymfrjv": "Has alcanzado el límite de {limit} sitios web. Actualiza para añadir más sitios web",
- "m5aC6r": "Rastrea analíticas para un nuevo sitio web en tu organización",
+ "AZEGID": "",
+ "JkLHGw": "",
+ "CXI0EW": "",
"oAFgOq": "Dominio",
+ "VQxsRK": "",
"3ARIAn": "Nombre de visualización (predeterminado: dominio)",
"fcj5H7": "Analíticas públicas",
"qQ21OF": "Cuando está habilitado, cualquiera puede ver las analíticas sin iniciar sesión",
"u/sVSP": "Activar Salting de ID de Usuario",
"yGxRRq": "Mejora la privacidad con sales rotativas diarias para los ID de usuario",
- "9ozcJb": "Error al añadir el sitio web",
+ "W35dz6": "",
"u6kSOz": "¿Te gusta Rybbit? ¡Considera patrocinar el proyecto!",
"IDklh3": "Patrocínanos",
"c/KktL": "Recursos",
@@ -888,6 +894,7 @@
"97KPX7": "No se encontraron etiquetas.",
"8Nc/jD": "No hay sitios web aún",
"nhaiN+": "Añade tu primer sitio web para empezar a rastrear analíticas",
+ "MzI/h2": "Añadir sitio web",
"/dxF+k": "La contraseña debe tener al menos 8 caracteres",
"6bxWvN": "Restablecimiento de contraseña exitoso",
"yAAjri": "Introduce el código OTP",
@@ -1255,24 +1262,24 @@
"f3ocee": "Excluye tráfico de países específicos. Los eventos de estos países no serán rastreados en tus analíticas.",
"ItR6u3": "Países excluidos ({count})",
"jm/spn": "Restablecer",
- "+CwN9C": "Sistema",
- "dmW5bt": "Abre la URL de inserción del panel privado en una nueva pestaña.",
- "PkGCG1": "Genera un enlace privado para probar la inserción del panel.",
- "UcHF+A": "Enlace privado generado",
- "6NIu/x": "Error al generar el enlace privado",
+ "+CwN9C": "",
+ "dmW5bt": "",
+ "PkGCG1": "",
+ "UcHF+A": "",
+ "6NIu/x": "",
"mBCW/X": "Inserción del Panel",
- "QRvU5C": "Inserta el panel de análisis principal en otro sitio usando un enlace privado.",
- "Ygzo5N": "Enlace privado",
- "KOXkeN": "Las inserciones del panel requieren un enlace privado. Cualquier persona con la URL del iframe puede ver el panel de solo lectura.",
- "PRAz+o": "Enlace privado habilitado",
+ "QRvU5C": "",
+ "Ygzo5N": "",
+ "KOXkeN": "",
+ "PRAz+o": "",
"Pe0ogR": "Tema",
- "WNF1J6": "Elige cómo se muestra el panel de control incrustado.",
+ "WNF1J6": "",
"FsIP28": "Ocultar barra lateral",
"dZAp5K": "Solo la página principal del panel puede verse desde esta inserción.",
- "oJEVob": "Pruébalo",
+ "oJEVob": "",
"JfG49w": "Abierta",
"TJo5E6": "Vista previa",
- "0uO8I3": "Generar un enlace privado para previsualizar",
+ "0uO8I3": "",
"CHzo7t": "Código de Inserción",
"m4+mLq": "Últimos 30 minutos",
"8O9cAb": "Últimas 24 horas",
@@ -1294,7 +1301,9 @@
"dcLGy5": "Muestra los 5 principales países que visitan tu sitio.",
"Eq9gxg": "Ancho (px)",
"l3J5rs": "Ancho del iframe. Usa max-width: 100% para diseños responsivos.",
+ "2YpSsF": "",
"VKppxp": "El dominio no puede estar vacío",
+ "HtTwhf": "",
"69jzMr": "Dominio actualizado correctamente",
"gwATc0": "Error al actualizar el dominio",
"mNRvgY": "Sitio eliminado correctamente",
@@ -1316,6 +1325,7 @@
"lnIbba": "Rastreo de dirección IP desactivado",
"DQO/Q8": "Nombre del sitio",
"7IM0G6": "El nombre de visualización de este sitio",
+ "zoRFJV": "",
"I7l2wK": "El dominio utilizado para el seguimiento",
"asd4Px": "Privacidad y Seguridad",
"gI1OXG": "Eliminar Sitio",
@@ -1370,6 +1380,8 @@
"biJyKp": "Excluye tráfico de direcciones o rangos de IP específicos. Soporta IPs individuales (192.168.1.1), notación CIDR (192.168.1.0/24) y rangos (192.168.1.1-192.168.1.10).",
"tH8S0d": "Añadir IP",
"pTHVrx": "Máximo 100 exclusiones de IP permitidas",
+ "pm+3nT": "",
+ "0Q1jqR": "",
"WFlQVv": "Script de seguimiento",
"EGPr1w": "Añade este script a la etiqueta {headTag} de tu sitio web",
"NPL5hM": "Omitir patrones",
@@ -1405,7 +1417,9 @@
"YluXPL": "Incluye parámetros de la cadena de consulta en el rastreo de páginas",
"kehGIT": "Rastreo de parámetros de URL activado",
"LIX+6S": "Rastreo de parámetros de URL desactivado",
+ "8s+sTd": "",
"fWblDI": "Vista de Página Inicial",
+ "495/Ut": "",
"ciDaNU": "Rastrea automáticamente la primera visita a la página cuando se carga el script",
"KzO2sB": "Rastreo de vista de página inicial activado",
"FcSY6x": "Rastreo de vista de página inicial desactivado",
@@ -1413,6 +1427,7 @@
"mFg4Ag": "Rastreo de enlaces salientes activado",
"sbjdWu": "Rastreo de enlaces salientes desactivado",
"5zGub0": "Rastreo de Errores",
+ "lxHUeO": "",
"4nfQk6": "Captura errores y excepciones de JavaScript de tu sitio",
"7LjSrf": "Rastreo de errores desactivado",
"u013P/": "Rastrea automáticamente clics en todos los botones",
diff --git a/client/messages/fr.json b/client/messages/fr.json
index 57f2c044e..533381815 100644
--- a/client/messages/fr.json
+++ b/client/messages/fr.json
@@ -66,12 +66,13 @@
"tL4WC1": "Chargement en cours...",
"HPx76n": "Tous les éléments chargés",
"QkTyho": "Barre latérale Rybbit",
+ "erYzJH": "",
"bnhHP6": "Analyse web",
"EFTSMc": "Principal",
"EYNe7E": "Globe",
"CxfKLC": "Pages",
"AA5h7P": "Performance",
- "LlNItA": "Bots",
+ "LlNItA": "",
"XHLYdJ": "Objectifs",
"9d/EEp": "Analyse produit",
"5yUsUe": "Replay",
@@ -87,7 +88,7 @@
"D3idYv": "Paramètres",
"yMG/h7": "Paramètres du site",
"yBqtD8": "{count} sessions (24h)",
- "MzI/h2": "Ajouter un site web",
+ "FIKvUB": "",
"Yxwqz8": "Aucun site sélectionné",
"Gpwv5L": "Rapport PDF téléchargé",
"zJPmwX": "Échec de la génération du rapport PDF",
@@ -328,10 +329,10 @@
"Lu6+QS": "",
"qdOqu/": "",
"tGuKrF": "",
- "W6nwjo": "Brouillon",
"LHF3Za": "",
- "47FYwb": "Annuler",
+ "W6nwjo": "Brouillon",
"rbrahO": "Fermer",
+ "47FYwb": "Annuler",
"cyR7Kh": "",
"TiR/Hq": "Enregistrement en cours...",
"mRL9Vh": "Création en cours...",
@@ -354,8 +355,8 @@
"l94vPo": "",
"qQTwNl": "",
"IuPATc": "",
- "W1QsrY": "",
"UBQJK/": "",
+ "W1QsrY": "",
"4IJvOg": "",
"iHip8n": "",
"kNp7lL": "",
@@ -593,6 +594,7 @@
"nGQuNF": "Pages par session",
"yunf47": "Durée de session",
"MnpyfA": "Utilisateurs uniques",
+ "kgLyso": "",
"RumeRz": "Régions",
"IFkDw5": "Villes",
"GsBRWL": "Langues",
@@ -831,17 +833,21 @@
"rDEYPT": "Sélectionnez l'organisation d'où retirer {email}. L'accès à toutes les ressources de cette organisation sera perdu.",
"3Vr8ps": "Tableau de bord admin",
"KI5ndC": "Format de domaine invalide. Doit être un domaine valide comme exemple.com ou sub.exemple.com",
+ "KI57sV": "",
"cGNlRB": "Passez à Pro pour ajouter plus de sites web",
"UpxSPM": "Vous devez avoir un abonnement actif pour ajouter des sites web",
"Ymfrjv": "Vous avez atteint la limite de {limit} sites web. Passez à un plan supérieur pour en ajouter plus",
- "m5aC6r": "Suivez les analyses d'un nouveau site web dans votre organisation",
+ "AZEGID": "",
+ "JkLHGw": "",
+ "CXI0EW": "",
"oAFgOq": "Domaine",
+ "VQxsRK": "",
"3ARIAn": "Nom d'affichage (par défaut : domaine)",
"fcj5H7": "Analyses publiques",
"qQ21OF": "Lorsque activé, n'importe qui peut voir les analyses sans se connecter",
"u/sVSP": "Activer le salage des ID utilisateur",
"yGxRRq": "Améliorez la confidentialité avec des sels rotatifs quotidiens pour les ID utilisateur",
- "9ozcJb": "Erreur lors de l'ajout du site web",
+ "W35dz6": "",
"u6kSOz": "Vous aimez Rybbit ? Pensez à sponsoriser le projet !",
"IDklh3": "Sponsorisez-nous",
"c/KktL": "Ressources",
@@ -888,6 +894,7 @@
"97KPX7": "Aucun tag trouvé.",
"8Nc/jD": "Aucun site web pour le moment",
"nhaiN+": "Ajoutez votre premier site web pour commencer à suivre les analyses",
+ "MzI/h2": "Ajouter un site web",
"/dxF+k": "Le mot de passe doit contenir au moins 8 caractères",
"6bxWvN": "Mot de passe réinitialisé avec succès",
"yAAjri": "Saisir le code OTP",
@@ -1255,24 +1262,24 @@
"f3ocee": "Excluez le trafic de pays spécifiques. Les événements de ces pays ne seront pas suivis dans vos analyses.",
"ItR6u3": "Pays exclus ({count})",
"jm/spn": "Réinitialiser",
- "+CwN9C": "Système",
- "dmW5bt": "Ouvrez l'URL d'intégration du tableau de bord privé dans un nouvel onglet.",
- "PkGCG1": "Générez un lien privé pour essayer l'intégration du tableau de bord.",
- "UcHF+A": "Lien privé généré",
- "6NIu/x": "Échec de la génération du lien privé",
+ "+CwN9C": "",
+ "dmW5bt": "",
+ "PkGCG1": "",
+ "UcHF+A": "",
+ "6NIu/x": "",
"mBCW/X": "Intégration du tableau de bord",
- "QRvU5C": "Intégrez le tableau de bord d'analyse principal sur un autre site à l'aide d'un lien privé.",
- "Ygzo5N": "Lien privé",
- "KOXkeN": "Les intégrations de tableau de bord nécessitent un lien privé. Toute personne disposant de l'URL de l'iframe peut consulter le tableau de bord en lecture seule.",
- "PRAz+o": "Lien privé activé",
+ "QRvU5C": "",
+ "Ygzo5N": "",
+ "KOXkeN": "",
+ "PRAz+o": "",
"Pe0ogR": "Thème",
- "WNF1J6": "Choisissez comment le tableau de bord intégré est affiché.",
+ "WNF1J6": "",
"FsIP28": "Masquer la barre latérale",
"dZAp5K": "Seule la page principale du tableau de bord peut être consultée depuis cette intégration.",
- "oJEVob": "Essayer",
+ "oJEVob": "",
"JfG49w": "Ouverte",
"TJo5E6": "Aperçu",
- "0uO8I3": "Générer un lien privé pour l'aperçu",
+ "0uO8I3": "",
"CHzo7t": "Code d'intégration",
"m4+mLq": "30 dernières minutes",
"8O9cAb": "Dernières 24 heures",
@@ -1294,7 +1301,9 @@
"dcLGy5": "Affiche les 5 premiers pays visitant votre site.",
"Eq9gxg": "Largeur (px)",
"l3J5rs": "Largeur de l'iframe. Utilisez max-width: 100% pour les mises en page responsives.",
+ "2YpSsF": "",
"VKppxp": "Le domaine ne peut pas être vide",
+ "HtTwhf": "",
"69jzMr": "Domaine mis à jour avec succès",
"gwATc0": "Échec de la mise à jour du domaine",
"mNRvgY": "Site supprimé avec succès",
@@ -1316,6 +1325,7 @@
"lnIbba": "Suivi des adresses IP désactivé",
"DQO/Q8": "Nom du site",
"7IM0G6": "Le nom d'affichage de ce site",
+ "zoRFJV": "",
"I7l2wK": "Le domaine utilisé pour le suivi",
"asd4Px": "Confidentialité et sécurité",
"gI1OXG": "Supprimer le site",
@@ -1370,6 +1380,8 @@
"biJyKp": "Excluez le trafic d'adresses IP ou de plages spécifiques. Prend en charge les IP individuelles (192.168.1.1), la notation CIDR (192.168.1.0/24) et les plages (192.168.1.1-192.168.1.10).",
"tH8S0d": "Ajouter une IP",
"pTHVrx": "Maximum 100 exclusions IP autorisées",
+ "pm+3nT": "",
+ "0Q1jqR": "",
"WFlQVv": "Script de suivi",
"EGPr1w": "Ajoutez ce script au {headTag} de votre site web",
"NPL5hM": "Modèles d'exclusion",
@@ -1405,7 +1417,9 @@
"YluXPL": "Inclure les paramètres de requête dans le suivi des pages",
"kehGIT": "Suivi des paramètres URL activé",
"LIX+6S": "Suivi des paramètres URL désactivé",
+ "8s+sTd": "",
"fWblDI": "Première page vue",
+ "495/Ut": "",
"ciDaNU": "Enregistrer automatiquement la première page vue au chargement du script",
"KzO2sB": "Suivi de la première page vue activé",
"FcSY6x": "Suivi de la première page vue désactivé",
@@ -1413,6 +1427,7 @@
"mFg4Ag": "Suivi des liens sortants activé",
"sbjdWu": "Suivi des liens sortants désactivé",
"5zGub0": "Suivi des erreurs",
+ "lxHUeO": "",
"4nfQk6": "Capturer les erreurs JavaScript et les exceptions de votre site",
"7LjSrf": "Suivi des erreurs désactivé",
"u013P/": "Suivre automatiquement les clics sur tous les boutons",
diff --git a/client/messages/it.json b/client/messages/it.json
index 7c14a03c0..898bc92d8 100644
--- a/client/messages/it.json
+++ b/client/messages/it.json
@@ -66,12 +66,13 @@
"tL4WC1": "Caricamento in corso...",
"HPx76n": "Tutti gli elementi caricati",
"QkTyho": "Barra Laterale Rybbit",
+ "erYzJH": "",
"bnhHP6": "Analisi Web",
"EFTSMc": "Principale",
"EYNe7E": "Globo",
"CxfKLC": "Pagine",
"AA5h7P": "Prestazioni",
- "LlNItA": "Bot",
+ "LlNItA": "",
"XHLYdJ": "Obiettivi",
"9d/EEp": "Analisi del Prodotto",
"5yUsUe": "Replay",
@@ -87,7 +88,7 @@
"D3idYv": "Impostazioni",
"yMG/h7": "Impostazioni Sito",
"yBqtD8": "{count} sessioni (24h)",
- "MzI/h2": "Aggiungi Sito Web",
+ "FIKvUB": "",
"Yxwqz8": "Nessun sito selezionato",
"Gpwv5L": "Report PDF scaricato",
"zJPmwX": "Impossibile generare il report PDF",
@@ -328,10 +329,10 @@
"Lu6+QS": "",
"qdOqu/": "",
"tGuKrF": "",
- "W6nwjo": "Bozza",
"LHF3Za": "",
- "47FYwb": "Annulla",
+ "W6nwjo": "Bozza",
"rbrahO": "Chiudi",
+ "47FYwb": "Annulla",
"cyR7Kh": "",
"TiR/Hq": "Salvataggio in corso...",
"mRL9Vh": "Creazione in corso...",
@@ -354,8 +355,8 @@
"l94vPo": "",
"qQTwNl": "",
"IuPATc": "",
- "W1QsrY": "",
"UBQJK/": "",
+ "W1QsrY": "",
"4IJvOg": "",
"iHip8n": "",
"kNp7lL": "",
@@ -593,6 +594,7 @@
"nGQuNF": "Pagine per Sessione",
"yunf47": "Durata Sessione",
"MnpyfA": "Utenti Unici",
+ "kgLyso": "",
"RumeRz": "Regioni",
"IFkDw5": "Città",
"GsBRWL": "Lingue",
@@ -831,17 +833,21 @@
"rDEYPT": "Seleziona l'organizzazione da cui rimuovere {email}. Perderà l'accesso a tutte le risorse in quell'organizzazione.",
"3Vr8ps": "Dashboard Amministratore",
"KI5ndC": "Formato dominio non valido. Deve essere un dominio valido come example.com o sub.example.com",
+ "KI57sV": "",
"cGNlRB": "Passa a Pro per aggiungere più siti web",
"UpxSPM": "Devi avere un abbonamento attivo per aggiungere siti web",
"Ymfrjv": "Hai raggiunto il limite di {limit} siti web. Aggiorna per aggiungere più siti web",
- "m5aC6r": "Traccia le analisi per un nuovo sito web nella tua organizzazione",
+ "AZEGID": "",
+ "JkLHGw": "",
+ "CXI0EW": "",
"oAFgOq": "Dominio",
+ "VQxsRK": "",
"3ARIAn": "Nome visualizzato (predefinito: dominio)",
"fcj5H7": "Analisi Pubbliche",
"qQ21OF": "Se abilitato, chiunque può visualizzare le analisi senza accedere",
"u/sVSP": "Abilita Salting ID Utente",
"yGxRRq": "Migliora la privacy con salting a rotazione giornaliera per gli ID utente",
- "9ozcJb": "Errore Aggiunta Sito Web",
+ "W35dz6": "",
"u6kSOz": "Ti piace Rybbit? Considera di sponsorizzare il progetto!",
"IDklh3": "Sponsorizzaci",
"c/KktL": "Risorse",
@@ -888,6 +894,7 @@
"97KPX7": "Nessun tag trovato.",
"8Nc/jD": "Ancora nessun sito web",
"nhaiN+": "Aggiungi il tuo primo sito web per iniziare a tracciare le analisi",
+ "MzI/h2": "Aggiungi Sito Web",
"/dxF+k": "La password deve essere lunga almeno 8 caratteri",
"6bxWvN": "Reimpostazione Password Avvenuta con Successo",
"yAAjri": "Inserisci Codice OTP",
@@ -1255,24 +1262,24 @@
"f3ocee": "Escludi traffico da paesi specifici. Gli eventi da questi paesi non verranno tracciati nelle tue analisi.",
"ItR6u3": "Paesi Esclusi ({count})",
"jm/spn": "Ripristina",
- "+CwN9C": "Sistema",
- "dmW5bt": "Apri l'URL di incorporazione della dashboard privata in una nuova scheda.",
- "PkGCG1": "Genera un link privato per provare l'incorporazione della dashboard.",
- "UcHF+A": "Link privato generato",
- "6NIu/x": "Impossibile generare il link privato",
+ "+CwN9C": "",
+ "dmW5bt": "",
+ "PkGCG1": "",
+ "UcHF+A": "",
+ "6NIu/x": "",
"mBCW/X": "Incorporamento Dashboard",
- "QRvU5C": "Incorpora la dashboard di analisi principale su un altro sito utilizzando un link privato.",
- "Ygzo5N": "Link privato",
- "KOXkeN": "Le incorporazioni della dashboard richiedono un link privato. Chiunque abbia l'URL dell'iframe può visualizzare la dashboard in sola lettura.",
- "PRAz+o": "Link privato abilitato",
+ "QRvU5C": "",
+ "Ygzo5N": "",
+ "KOXkeN": "",
+ "PRAz+o": "",
"Pe0ogR": "Tema",
- "WNF1J6": "Scegli come viene visualizzata la dashboard incorporata.",
+ "WNF1J6": "",
"FsIP28": "Nascondi barra laterale",
"dZAp5K": "Solo la pagina principale del dashboard può essere visualizzata da questo incorporamento.",
- "oJEVob": "Prova",
+ "oJEVob": "",
"JfG49w": "Aperta",
"TJo5E6": "Anteprima",
- "0uO8I3": "Genera un link privato per l'anteprima",
+ "0uO8I3": "",
"CHzo7t": "Codice di Incorporamento",
"m4+mLq": "Ultimi 30 minuti",
"8O9cAb": "Ultime 24 ore",
@@ -1294,7 +1301,9 @@
"dcLGy5": "Visualizza i 5 paesi principali che visitano il tuo sito.",
"Eq9gxg": "Larghezza (px)",
"l3J5rs": "Larghezza iframe. Usa max-width: 100% per layout responsivi.",
+ "2YpSsF": "",
"VKppxp": "Il dominio non può essere vuoto",
+ "HtTwhf": "",
"69jzMr": "Dominio aggiornato con successo",
"gwATc0": "Impossibile aggiornare il dominio",
"mNRvgY": "Sito eliminato con successo",
@@ -1316,6 +1325,7 @@
"lnIbba": "Tracciamento indirizzo IP disabilitato",
"DQO/Q8": "Nome del sito",
"7IM0G6": "Il nome visualizzato per questo sito",
+ "zoRFJV": "",
"I7l2wK": "Il dominio utilizzato per il tracciamento",
"asd4Px": "Privacy & Sicurezza",
"gI1OXG": "Elimina Sito",
@@ -1370,6 +1380,8 @@
"biJyKp": "Escludi traffico da indirizzi o intervalli IP specifici. Supporta IP singoli (192.168.1.1), notazione CIDR (192.168.1.0/24) e intervalli (192.168.1.1-192.168.1.10).",
"tH8S0d": "Aggiungi IP",
"pTHVrx": "Massimo 100 esclusioni IP consentite",
+ "pm+3nT": "",
+ "0Q1jqR": "",
"WFlQVv": "Script di Tracciamento",
"EGPr1w": "Aggiungi questo script al {headTag} del tuo sito web",
"NPL5hM": "Salta Modelli",
@@ -1405,7 +1417,9 @@
"YluXPL": "Includi i parametri della query string nel tracciamento della pagina",
"kehGIT": "Tracciamento parametri URL abilitato",
"LIX+6S": "Tracciamento parametri URL disabilitato",
+ "8s+sTd": "",
"fWblDI": "Visualizzazione Pagina Iniziale",
+ "495/Ut": "",
"ciDaNU": "Traccia automaticamente la prima visualizzazione di pagina al caricamento dello script",
"KzO2sB": "Tracciamento visualizzazione pagina iniziale abilitato",
"FcSY6x": "Tracciamento visualizzazione pagina iniziale disabilitato",
@@ -1413,6 +1427,7 @@
"mFg4Ag": "Tracciamento link in uscita abilitato",
"sbjdWu": "Tracciamento link in uscita disabilitato",
"5zGub0": "Tracciamento Errori",
+ "lxHUeO": "",
"4nfQk6": "Cattura errori ed eccezioni JavaScript dal tuo sito",
"7LjSrf": "Tracciamento errori disabilitato",
"u013P/": "Traccia automaticamente i clic su tutti i pulsanti",
diff --git a/client/messages/ja.json b/client/messages/ja.json
index 2e5e21922..ed8142bf4 100644
--- a/client/messages/ja.json
+++ b/client/messages/ja.json
@@ -66,12 +66,13 @@
"tL4WC1": "さらに読み込み中...",
"HPx76n": "すべて読み込み済み",
"QkTyho": "Rybbitサイドバー",
+ "erYzJH": "",
"bnhHP6": "ウェブアナリティクス",
"EFTSMc": "メイン",
"EYNe7E": "グローブ",
"CxfKLC": "ページ",
"AA5h7P": "パフォーマンス",
- "LlNItA": "ボット",
+ "LlNItA": "",
"XHLYdJ": "目標",
"9d/EEp": "プロダクトアナリティクス",
"5yUsUe": "リプレイ",
@@ -87,7 +88,7 @@
"D3idYv": "設定",
"yMG/h7": "サイト設定",
"yBqtD8": "{count}セッション (24時間)",
- "MzI/h2": "ウェブサイトを追加",
+ "FIKvUB": "",
"Yxwqz8": "サイトが選択されていません",
"Gpwv5L": "PDFレポートをダウンロードしました",
"zJPmwX": "PDFレポートの生成に失敗しました",
@@ -328,10 +329,10 @@
"Lu6+QS": "",
"qdOqu/": "",
"tGuKrF": "",
- "W6nwjo": "下書き",
"LHF3Za": "",
- "47FYwb": "キャンセル",
+ "W6nwjo": "下書き",
"rbrahO": "閉じる",
+ "47FYwb": "キャンセル",
"cyR7Kh": "",
"TiR/Hq": "保存中...",
"mRL9Vh": "作成中...",
@@ -354,8 +355,8 @@
"l94vPo": "",
"qQTwNl": "",
"IuPATc": "",
- "W1QsrY": "",
"UBQJK/": "",
+ "W1QsrY": "",
"4IJvOg": "",
"iHip8n": "",
"kNp7lL": "",
@@ -593,6 +594,7 @@
"nGQuNF": "セッションあたりのページ数",
"yunf47": "セッション時間",
"MnpyfA": "ユニークユーザー",
+ "kgLyso": "",
"RumeRz": "地域",
"IFkDw5": "都市",
"GsBRWL": "言語",
@@ -831,17 +833,21 @@
"rDEYPT": "{email}を削除する組織を選択してください。その組織のすべてのリソースへのアクセスが失われます。",
"3Vr8ps": "管理者ダッシュボード",
"KI5ndC": "無効なドメイン形式です。example.comまたはsub.example.comのような有効なドメインを入力してください",
+ "KI57sV": "",
"cGNlRB": "Proにアップグレードしてウェブサイトを追加",
"UpxSPM": "ウェブサイトを追加するにはアクティブなサブスクリプションが必要です",
"Ymfrjv": "ウェブサイトの上限{limit}に達しました。アップグレードしてウェブサイトを追加してください",
- "m5aC6r": "組織で新しいウェブサイトのアナリティクスを追跡",
+ "AZEGID": "",
+ "JkLHGw": "",
+ "CXI0EW": "",
"oAFgOq": "ドメイン",
+ "VQxsRK": "",
"3ARIAn": "表示名(デフォルトはドメイン)",
"fcj5H7": "公開アナリティクス",
"qQ21OF": "有効にすると、ログインなしで誰でもアナリティクスを閲覧できます",
"u/sVSP": "ユーザーIDソルトを有効化",
"yGxRRq": "日次ローテーションソルトでユーザーIDのプライバシーを強化",
- "9ozcJb": "ウェブサイト追加エラー",
+ "W35dz6": "",
"u6kSOz": "Rybbitを気に入っていただけましたか?プロジェクトのスポンサーをご検討ください!",
"IDklh3": "スポンサーになる",
"c/KktL": "リソース",
@@ -888,6 +894,7 @@
"97KPX7": "タグが見つかりません。",
"8Nc/jD": "ウェブサイトがまだありません",
"nhaiN+": "最初のウェブサイトを追加してアナリティクスの追跡を開始しましょう",
+ "MzI/h2": "ウェブサイトを追加",
"/dxF+k": "パスワードは8文字以上である必要があります",
"6bxWvN": "パスワードのリセットに成功しました",
"yAAjri": "OTPコードを入力",
@@ -1255,24 +1262,24 @@
"f3ocee": "特定の国からのトラフィックを除外します。これらの国からのイベントはアナリティクスで追跡されません。",
"ItR6u3": "除外国({count})",
"jm/spn": "リセット",
- "+CwN9C": "システム",
- "dmW5bt": "プライベートダッシュボードの埋め込みURLを新しいタブで開く。",
- "PkGCG1": "ダッシュボード埋め込みを試すためのプライベートリンクを生成してください。",
- "UcHF+A": "プライベートリンクが生成されました",
- "6NIu/x": "プライベートリンクの生成に失敗しました",
+ "+CwN9C": "",
+ "dmW5bt": "",
+ "PkGCG1": "",
+ "UcHF+A": "",
+ "6NIu/x": "",
"mBCW/X": "ダッシュボード埋め込み",
- "QRvU5C": "プライベートリンクを使用して、メインの分析ダッシュボードを別のサイトに埋め込む。",
- "Ygzo5N": "プライベートリンク",
- "KOXkeN": "ダッシュボードの埋め込みにはプライベートリンクが必要です。iframeのURLを持つ人は誰でも読み取り専用ダッシュボードを表示できます。",
- "PRAz+o": "プライベートリンクが有効",
+ "QRvU5C": "",
+ "Ygzo5N": "",
+ "KOXkeN": "",
+ "PRAz+o": "",
"Pe0ogR": "テーマ",
- "WNF1J6": "埋め込みダッシュボードの表示方法を選択してください。",
+ "WNF1J6": "",
"FsIP28": "サイドバーを非表示",
"dZAp5K": "この埋め込みではメインダッシュボードページのみ表示できます。",
- "oJEVob": "試してみる",
+ "oJEVob": "",
"JfG49w": "未決済",
"TJo5E6": "プレビュー",
- "0uO8I3": "プレビューするためのプライベートリンクを生成",
+ "0uO8I3": "",
"CHzo7t": "埋め込みコード",
"m4+mLq": "過去30分",
"8O9cAb": "過去24時間",
@@ -1294,7 +1301,9 @@
"dcLGy5": "サイトを訪問している上位5か国を表示します。",
"Eq9gxg": "幅 (px)",
"l3J5rs": "iframeの幅。レスポンシブレイアウトにはmax-width: 100%を使用してください。",
+ "2YpSsF": "",
"VKppxp": "ドメインを空にすることはできません",
+ "HtTwhf": "",
"69jzMr": "ドメインを更新しました",
"gwATc0": "ドメインの更新に失敗しました",
"mNRvgY": "サイトを削除しました",
@@ -1316,6 +1325,7 @@
"lnIbba": "IPアドレス追跡を無効にしました",
"DQO/Q8": "サイト名",
"7IM0G6": "このサイトの表示名",
+ "zoRFJV": "",
"I7l2wK": "トラッキングに使用するドメイン",
"asd4Px": "プライバシーとセキュリティ",
"gI1OXG": "サイトを削除",
@@ -1370,6 +1380,8 @@
"biJyKp": "特定のIPアドレスまたは範囲からのトラフィックを除外します。単一IP(192.168.1.1)、CIDR表記(192.168.1.0/24)、範囲(192.168.1.1-192.168.1.10)をサポートしています。",
"tH8S0d": "IPを追加",
"pTHVrx": "IP除外は最大100件まで",
+ "pm+3nT": "",
+ "0Q1jqR": "",
"WFlQVv": "トラッキングスクリプト",
"EGPr1w": "ウェブサイトの{headTag}にこのスクリプトを追加",
"NPL5hM": "スキップパターン",
@@ -1405,7 +1417,9 @@
"YluXPL": "ページ追跡にクエリ文字列パラメータを含める",
"kehGIT": "URLパラメータ追跡を有効にしました",
"LIX+6S": "URLパラメータ追跡を無効にしました",
+ "8s+sTd": "",
"fWblDI": "初回ページビュー",
+ "495/Ut": "",
"ciDaNU": "スクリプト読み込み時に最初のページビューを自動追跡",
"KzO2sB": "初回ページビュー追跡を有効にしました",
"FcSY6x": "初回ページビュー追跡を無効にしました",
@@ -1413,6 +1427,7 @@
"mFg4Ag": "外部リンク追跡を有効にしました",
"sbjdWu": "外部リンク追跡を無効にしました",
"5zGub0": "エラートラッキング",
+ "lxHUeO": "",
"4nfQk6": "サイトのJavaScriptエラーと例外をキャプチャ",
"7LjSrf": "エラートラッキングを無効にしました",
"u013P/": "すべてのボタンのクリックを自動追跡",
diff --git a/client/messages/ko.json b/client/messages/ko.json
index 731d7fca4..7cfe3702d 100644
--- a/client/messages/ko.json
+++ b/client/messages/ko.json
@@ -66,12 +66,13 @@
"tL4WC1": "더 불러오는 중...",
"HPx76n": "모든 항목 로드됨",
"QkTyho": "Rybbit 사이드바",
+ "erYzJH": "",
"bnhHP6": "웹 분석",
"EFTSMc": "메인",
"EYNe7E": "글로브",
"CxfKLC": "페이지",
"AA5h7P": "성능",
- "LlNItA": "봇",
+ "LlNItA": "",
"XHLYdJ": "목표",
"9d/EEp": "제품 분석",
"5yUsUe": "리플레이",
@@ -87,7 +88,7 @@
"D3idYv": "설정",
"yMG/h7": "사이트 설정",
"yBqtD8": "{count}개 세션 (24시간)",
- "MzI/h2": "웹사이트 추가",
+ "FIKvUB": "",
"Yxwqz8": "사이트 미선택",
"Gpwv5L": "PDF 보고서 다운로드 완료",
"zJPmwX": "PDF 보고서 생성 실패",
@@ -328,10 +329,10 @@
"Lu6+QS": "",
"qdOqu/": "",
"tGuKrF": "",
- "W6nwjo": "초안",
"LHF3Za": "",
- "47FYwb": "취소",
+ "W6nwjo": "초안",
"rbrahO": "닫기",
+ "47FYwb": "취소",
"cyR7Kh": "",
"TiR/Hq": "저장 중...",
"mRL9Vh": "생성 중...",
@@ -354,8 +355,8 @@
"l94vPo": "",
"qQTwNl": "",
"IuPATc": "",
- "W1QsrY": "",
"UBQJK/": "",
+ "W1QsrY": "",
"4IJvOg": "",
"iHip8n": "",
"kNp7lL": "",
@@ -593,6 +594,7 @@
"nGQuNF": "세션당 페이지",
"yunf47": "세션 시간",
"MnpyfA": "고유 사용자",
+ "kgLyso": "",
"RumeRz": "지역",
"IFkDw5": "도시",
"GsBRWL": "언어",
@@ -831,17 +833,21 @@
"rDEYPT": "{email}을(를) 제거할 조직을 선택하세요. 해당 조직의 모든 리소스에 대한 액세스를 잃게 됩니다.",
"3Vr8ps": "관리자 대시보드",
"KI5ndC": "잘못된 도메인 형식입니다. example.com 또는 sub.example.com과 같은 유효한 도메인이어야 합니다",
+ "KI57sV": "",
"cGNlRB": "Pro로 업그레이드하여 더 많은 웹사이트를 추가하세요",
"UpxSPM": "웹사이트를 추가하려면 활성 구독이 필요합니다",
"Ymfrjv": "웹사이트 한도 {limit}개에 도달했습니다. 업그레이드하여 더 많은 웹사이트를 추가하세요",
- "m5aC6r": "조직에서 새 웹사이트의 분석을 추적합니다",
+ "AZEGID": "",
+ "JkLHGw": "",
+ "CXI0EW": "",
"oAFgOq": "도메인",
+ "VQxsRK": "",
"3ARIAn": "표시 이름 (기본값: 도메인)",
"fcj5H7": "공개 분석",
"qQ21OF": "활성화하면 로그인 없이 누구나 분석을 볼 수 있습니다",
"u/sVSP": "사용자 ID 솔팅 활성화",
"yGxRRq": "일일 회전 솔트로 사용자 ID 개인정보 보호 강화",
- "9ozcJb": "웹사이트 추가 오류",
+ "W35dz6": "",
"u6kSOz": "Rybbit이 마음에 드셨나요? 프로젝트 후원을 고려해 주세요!",
"IDklh3": "후원하기",
"c/KktL": "리소스",
@@ -888,6 +894,7 @@
"97KPX7": "태그를 찾을 수 없습니다.",
"8Nc/jD": "아직 웹사이트가 없습니다",
"nhaiN+": "첫 번째 웹사이트를 추가하여 분석 추적을 시작하세요",
+ "MzI/h2": "웹사이트 추가",
"/dxF+k": "비밀번호는 8자 이상이어야 합니다",
"6bxWvN": "비밀번호 재설정 성공",
"yAAjri": "OTP 코드 입력",
@@ -1255,24 +1262,24 @@
"f3ocee": "특정 국가의 트래픽을 제외합니다. 이 국가의 이벤트는 분석에 추적되지 않습니다.",
"ItR6u3": "제외된 국가 ({count})",
"jm/spn": "초기화",
- "+CwN9C": "시스템",
- "dmW5bt": "새 탭에서 비공개 대시보드 임베드 URL을 여세요.",
- "PkGCG1": "대시보드 임베드를 사용해 보려면 비공개 링크를 생성하세요.",
- "UcHF+A": "비공개 링크 생성됨",
- "6NIu/x": "비공개 링크 생성 실패",
+ "+CwN9C": "",
+ "dmW5bt": "",
+ "PkGCG1": "",
+ "UcHF+A": "",
+ "6NIu/x": "",
"mBCW/X": "대시보드 임베드",
- "QRvU5C": "비공개 링크를 사용하여 기본 분석 대시보드를 다른 사이트에 임베드하세요.",
- "Ygzo5N": "비공개 링크",
- "KOXkeN": "대시보드 임베드에는 비공개 링크가 필요합니다. iframe URL을 가진 모든 사람이 읽기 전용 대시보드를 볼 수 있습니다.",
- "PRAz+o": "비공개 링크 활성화됨",
+ "QRvU5C": "",
+ "Ygzo5N": "",
+ "KOXkeN": "",
+ "PRAz+o": "",
"Pe0ogR": "테마",
- "WNF1J6": "임베드된 대시보드의 표시 방법을 선택하세요.",
+ "WNF1J6": "",
"FsIP28": "사이드바 숨기기",
"dZAp5K": "이 임베드에서는 메인 대시보드 페이지만 볼 수 있습니다.",
- "oJEVob": "사용해보기",
+ "oJEVob": "",
"JfG49w": "미결제",
"TJo5E6": "미리보기",
- "0uO8I3": "미리보기용 비공개 링크 생성",
+ "0uO8I3": "",
"CHzo7t": "임베드 코드",
"m4+mLq": "최근 30분",
"8O9cAb": "최근 24시간",
@@ -1294,7 +1301,9 @@
"dcLGy5": "사이트를 방문하는 상위 5개 국가를 표시합니다.",
"Eq9gxg": "너비 (px)",
"l3J5rs": "Iframe 너비. 반응형 레이아웃에는 max-width: 100%를 사용하세요.",
+ "2YpSsF": "",
"VKppxp": "도메인은 비워둘 수 없습니다",
+ "HtTwhf": "",
"69jzMr": "도메인이 성공적으로 업데이트되었습니다",
"gwATc0": "도메인 업데이트 실패",
"mNRvgY": "사이트가 성공적으로 삭제되었습니다",
@@ -1316,6 +1325,7 @@
"lnIbba": "IP 주소 추적 비활성화됨",
"DQO/Q8": "사이트 이름",
"7IM0G6": "이 사이트의 표시 이름",
+ "zoRFJV": "",
"I7l2wK": "추적에 사용되는 도메인",
"asd4Px": "개인정보 및 보안",
"gI1OXG": "사이트 삭제",
@@ -1370,6 +1380,8 @@
"biJyKp": "특정 IP 주소 또는 범위의 트래픽을 제외합니다. 단일 IP (192.168.1.1), CIDR 표기법 (192.168.1.0/24), 범위 (192.168.1.1-192.168.1.10)를 지원합니다.",
"tH8S0d": "IP 추가",
"pTHVrx": "최대 100개의 IP 제외가 허용됩니다",
+ "pm+3nT": "",
+ "0Q1jqR": "",
"WFlQVv": "추적 스크립트",
"EGPr1w": "웹사이트의 {headTag}에 이 스크립트를 추가하세요",
"NPL5hM": "건너뛰기 패턴",
@@ -1405,7 +1417,9 @@
"YluXPL": "페이지 추적에 쿼리 문자열 매개변수를 포함합니다",
"kehGIT": "URL 매개변수 추적 활성화됨",
"LIX+6S": "URL 매개변수 추적 비활성화됨",
+ "8s+sTd": "",
"fWblDI": "초기 페이지뷰",
+ "495/Ut": "",
"ciDaNU": "스크립트 로드 시 첫 번째 페이지뷰를 자동으로 추적합니다",
"KzO2sB": "초기 페이지뷰 추적 활성화됨",
"FcSY6x": "초기 페이지뷰 추적 비활성화됨",
@@ -1413,6 +1427,7 @@
"mFg4Ag": "외부 링크 추적 활성화됨",
"sbjdWu": "외부 링크 추적 비활성화됨",
"5zGub0": "오류 추적",
+ "lxHUeO": "",
"4nfQk6": "사이트에서 JavaScript 오류 및 예외를 캡처합니다",
"7LjSrf": "오류 추적 비활성화됨",
"u013P/": "모든 버튼 클릭을 자동으로 추적합니다",
diff --git a/client/messages/pl.json b/client/messages/pl.json
index 356972cfa..476d7c535 100644
--- a/client/messages/pl.json
+++ b/client/messages/pl.json
@@ -66,12 +66,13 @@
"tL4WC1": "Ładowanie kolejnych...",
"HPx76n": "Wszystkie elementy załadowane",
"QkTyho": "Panel boczny Rybbit",
+ "erYzJH": "",
"bnhHP6": "Analityka internetowa",
"EFTSMc": "Główne",
"EYNe7E": "Globus",
"CxfKLC": "Strony",
"AA5h7P": "Wydajność",
- "LlNItA": "Boty",
+ "LlNItA": "",
"XHLYdJ": "Cele",
"9d/EEp": "Analityka produktowa",
"5yUsUe": "Odtwarzanie",
@@ -87,7 +88,7 @@
"D3idYv": "Ustawienia",
"yMG/h7": "Ustawienia strony",
"yBqtD8": "{count} sesji (24h)",
- "MzI/h2": "Dodaj stronę",
+ "FIKvUB": "",
"Yxwqz8": "Nie wybrano strony",
"Gpwv5L": "Pobrano raport PDF",
"zJPmwX": "Nie udało się wygenerować raportu PDF",
@@ -328,10 +329,10 @@
"Lu6+QS": "",
"qdOqu/": "",
"tGuKrF": "",
- "W6nwjo": "Szkic",
"LHF3Za": "",
- "47FYwb": "Anuluj",
+ "W6nwjo": "Szkic",
"rbrahO": "Zamknij",
+ "47FYwb": "Anuluj",
"cyR7Kh": "",
"TiR/Hq": "Zapisywanie...",
"mRL9Vh": "Tworzenie...",
@@ -354,8 +355,8 @@
"l94vPo": "",
"qQTwNl": "",
"IuPATc": "",
- "W1QsrY": "",
"UBQJK/": "",
+ "W1QsrY": "",
"4IJvOg": "",
"iHip8n": "",
"kNp7lL": "",
@@ -593,6 +594,7 @@
"nGQuNF": "Strony na sesję",
"yunf47": "Czas trwania sesji",
"MnpyfA": "Unikalni użytkownicy",
+ "kgLyso": "",
"RumeRz": "Regiony",
"IFkDw5": "Miasta",
"GsBRWL": "Języki",
@@ -831,17 +833,21 @@
"rDEYPT": "Wybierz organizację, z której chcesz usunąć {email}. Straci dostęp do wszystkich zasobów tej organizacji.",
"3Vr8ps": "Panel administratora",
"KI5ndC": "Nieprawidłowy format domeny. Musi być prawidłową domeną, np. example.com lub sub.example.com",
+ "KI57sV": "",
"cGNlRB": "Ulepsz do Pro, aby dodać więcej stron",
"UpxSPM": "Musisz mieć aktywną subskrypcję, aby dodawać strony",
"Ymfrjv": "Osiągnięto limit {limit} stron. Ulepsz plan, aby dodać więcej stron",
- "m5aC6r": "Śledź analitykę nowej strony w swojej organizacji",
+ "AZEGID": "",
+ "JkLHGw": "",
+ "CXI0EW": "",
"oAFgOq": "Domena",
+ "VQxsRK": "",
"3ARIAn": "Nazwa wyświetlana (domyślnie domena)",
"fcj5H7": "Publiczna analityka",
"qQ21OF": "Po włączeniu każdy może przeglądać analitykę bez logowania",
"u/sVSP": "Włącz solenie ID użytkownika",
"yGxRRq": "Zwiększ prywatność dzięki codziennie rotowanym solom dla ID użytkowników",
- "9ozcJb": "Błąd dodawania strony",
+ "W35dz6": "",
"u6kSOz": "Podoba Ci się Rybbit? Rozważ sponsorowanie projektu!",
"IDklh3": "Sponsoruj nas",
"c/KktL": "Zasoby",
@@ -888,6 +894,7 @@
"97KPX7": "Nie znaleziono tagów.",
"8Nc/jD": "Brak stron",
"nhaiN+": "Dodaj swoją pierwszą stronę, aby rozpocząć śledzenie analityki",
+ "MzI/h2": "Dodaj stronę",
"/dxF+k": "Hasło musi mieć co najmniej 8 znaków",
"6bxWvN": "Hasło zresetowane pomyślnie",
"yAAjri": "Wprowadź kod OTP",
@@ -1255,24 +1262,24 @@
"f3ocee": "Wyklucz ruch z określonych krajów. Zdarzenia z tych krajów nie będą śledzone w Twojej analityce.",
"ItR6u3": "Wykluczone kraje ({count})",
"jm/spn": "Resetuj",
- "+CwN9C": "System",
- "dmW5bt": "Otwórz prywatny URL osadzania pulpitu nawigacyjnego w nowej karcie.",
- "PkGCG1": "Wygeneruj prywatny link, aby wypróbować osadzenie pulpitu nawigacyjnego.",
- "UcHF+A": "Prywatny link wygenerowany",
- "6NIu/x": "Nie udało się wygenerować prywatnego linku",
+ "+CwN9C": "",
+ "dmW5bt": "",
+ "PkGCG1": "",
+ "UcHF+A": "",
+ "6NIu/x": "",
"mBCW/X": "Osadzenie panelu",
- "QRvU5C": "Osadź główny pulpit nawigacyjny analityki na innej stronie za pomocą prywatnego linku.",
- "Ygzo5N": "Prywatny link",
- "KOXkeN": "Osadzanie pulpitu nawigacyjnego wymaga prywatnego linku. Każdy z adresem URL iframe może wyświetlić pulpit nawigacyjny w trybie tylko do odczytu.",
- "PRAz+o": "Prywatny link włączony",
+ "QRvU5C": "",
+ "Ygzo5N": "",
+ "KOXkeN": "",
+ "PRAz+o": "",
"Pe0ogR": "Motyw",
- "WNF1J6": "Wybierz sposób wyświetlania osadzonego pulpitu nawigacyjnego.",
+ "WNF1J6": "",
"FsIP28": "Ukryj pasek boczny",
"dZAp5K": "Z tego osadzenia można wyświetlić tylko główną stronę panelu.",
- "oJEVob": "Wypróbuj",
+ "oJEVob": "",
"JfG49w": "Otwarta",
"TJo5E6": "Podgląd",
- "0uO8I3": "Wygeneruj prywatny link do podglądu",
+ "0uO8I3": "",
"CHzo7t": "Kod osadzenia",
"m4+mLq": "Ostatnie 30 minut",
"8O9cAb": "Ostatnie 24 godziny",
@@ -1294,7 +1301,9 @@
"dcLGy5": "Wyświetl 5 najczęstszych krajów odwiedzających Twoją stronę.",
"Eq9gxg": "Szerokość (px)",
"l3J5rs": "Szerokość iframe. Użyj max-width: 100% dla układów responsywnych.",
+ "2YpSsF": "",
"VKppxp": "Domena nie może być pusta",
+ "HtTwhf": "",
"69jzMr": "Domena zaktualizowana pomyślnie",
"gwATc0": "Nie udało się zaktualizować domeny",
"mNRvgY": "Strona usunięta pomyślnie",
@@ -1316,6 +1325,7 @@
"lnIbba": "Śledzenie adresów IP wyłączone",
"DQO/Q8": "Nazwa witryny",
"7IM0G6": "Nazwa wyświetlana dla tej witryny",
+ "zoRFJV": "",
"I7l2wK": "Domena używana do śledzenia",
"asd4Px": "Prywatność i bezpieczeństwo",
"gI1OXG": "Usuń stronę",
@@ -1370,6 +1380,8 @@
"biJyKp": "Wyklucz ruch z określonych adresów IP lub zakresów. Obsługuje pojedyncze adresy IP (192.168.1.1), notację CIDR (192.168.1.0/24) i zakresy (192.168.1.1-192.168.1.10).",
"tH8S0d": "Dodaj IP",
"pTHVrx": "Maksymalnie 100 wykluczeń IP",
+ "pm+3nT": "",
+ "0Q1jqR": "",
"WFlQVv": "Skrypt śledzenia",
"EGPr1w": "Dodaj ten skrypt do {headTag} swojej strony",
"NPL5hM": "Wzorce pomijania",
@@ -1405,7 +1417,9 @@
"YluXPL": "Uwzględnij parametry zapytania w śledzeniu stron",
"kehGIT": "Śledzenie parametrów URL włączone",
"LIX+6S": "Śledzenie parametrów URL wyłączone",
+ "8s+sTd": "",
"fWblDI": "Początkowa odsłona strony",
+ "495/Ut": "",
"ciDaNU": "Automatycznie śledź pierwszą odsłonę strony po załadowaniu skryptu",
"KzO2sB": "Śledzenie początkowej odsłony włączone",
"FcSY6x": "Śledzenie początkowej odsłony wyłączone",
@@ -1413,6 +1427,7 @@
"mFg4Ag": "Śledzenie linków wychodzących włączone",
"sbjdWu": "Śledzenie linków wychodzących wyłączone",
"5zGub0": "Śledzenie błędów",
+ "lxHUeO": "",
"4nfQk6": "Przechwytuj błędy JavaScript i wyjątki ze swojej strony",
"7LjSrf": "Śledzenie błędów wyłączone",
"u013P/": "Automatycznie śledź kliknięcia we wszystkie przyciski",
diff --git a/client/messages/pt.json b/client/messages/pt.json
index d8cdb7751..242e405e4 100644
--- a/client/messages/pt.json
+++ b/client/messages/pt.json
@@ -66,12 +66,13 @@
"tL4WC1": "Carregando mais...",
"HPx76n": "Todos os itens carregados",
"QkTyho": "Barra Lateral do Rybbit",
+ "erYzJH": "",
"bnhHP6": "Análise Web",
"EFTSMc": "Principal",
"EYNe7E": "Globo",
"CxfKLC": "Páginas",
"AA5h7P": "Desempenho",
- "LlNItA": "Bots",
+ "LlNItA": "",
"XHLYdJ": "Metas",
"9d/EEp": "Análise de Produto",
"5yUsUe": "Replay",
@@ -87,7 +88,7 @@
"D3idYv": "Configurações",
"yMG/h7": "Configurações do Site",
"yBqtD8": "{count} sessões (24h)",
- "MzI/h2": "Adicionar Site",
+ "FIKvUB": "",
"Yxwqz8": "Nenhum site selecionado",
"Gpwv5L": "Relatório PDF baixado",
"zJPmwX": "Falha ao gerar relatório PDF",
@@ -328,10 +329,10 @@
"Lu6+QS": "",
"qdOqu/": "",
"tGuKrF": "",
- "W6nwjo": "Rascunho",
"LHF3Za": "",
- "47FYwb": "Cancelar",
+ "W6nwjo": "Rascunho",
"rbrahO": "Fechar",
+ "47FYwb": "Cancelar",
"cyR7Kh": "",
"TiR/Hq": "Salvando...",
"mRL9Vh": "Criando...",
@@ -354,8 +355,8 @@
"l94vPo": "",
"qQTwNl": "",
"IuPATc": "",
- "W1QsrY": "",
"UBQJK/": "",
+ "W1QsrY": "",
"4IJvOg": "",
"iHip8n": "",
"kNp7lL": "",
@@ -593,6 +594,7 @@
"nGQuNF": "Páginas por Sessão",
"yunf47": "Duração da Sessão",
"MnpyfA": "Usuários Únicos",
+ "kgLyso": "",
"RumeRz": "Regiões",
"IFkDw5": "Cidades",
"GsBRWL": "Idiomas",
@@ -831,17 +833,21 @@
"rDEYPT": "Selecione a organização da qual remover {email}. Ele perderá acesso a todos os recursos dessa organização.",
"3Vr8ps": "Painel Administrativo",
"KI5ndC": "Formato de domínio inválido. Deve ser um domínio válido como exemplo.com ou sub.exemplo.com",
+ "KI57sV": "",
"cGNlRB": "Atualize para Pro para adicionar mais sites",
"UpxSPM": "Você precisa ter uma assinatura ativa para adicionar sites",
"Ymfrjv": "Você atingiu o limite de {limit} sites. Atualize para adicionar mais sites",
- "m5aC6r": "Rastreie análises de um novo site na sua organização",
+ "AZEGID": "",
+ "JkLHGw": "",
+ "CXI0EW": "",
"oAFgOq": "Domínio",
+ "VQxsRK": "",
"3ARIAn": "Nome de exibição (padrão é o domínio)",
"fcj5H7": "Análises Públicas",
"qQ21OF": "Quando ativado, qualquer pessoa pode visualizar as análises sem fazer login",
"u/sVSP": "Ativar Salting de ID de Usuário",
"yGxRRq": "Aumente a privacidade com salts rotativos diários para IDs de usuário",
- "9ozcJb": "Erro ao Adicionar Site",
+ "W35dz6": "",
"u6kSOz": "Gostando do Rybbit? Considere patrocinar o projeto!",
"IDklh3": "Patrocine-nos",
"c/KktL": "Recursos",
@@ -888,6 +894,7 @@
"97KPX7": "Nenhuma tag encontrada.",
"8Nc/jD": "Nenhum site ainda",
"nhaiN+": "Adicione seu primeiro site para começar a rastrear análises",
+ "MzI/h2": "Adicionar Site",
"/dxF+k": "A senha deve ter pelo menos 8 caracteres",
"6bxWvN": "Senha Redefinida com Sucesso",
"yAAjri": "Digite o Código OTP",
@@ -1255,24 +1262,24 @@
"f3ocee": "Exclua tráfego de países específicos. Eventos desses países não serão rastreados nas suas análises.",
"ItR6u3": "Países Excluídos ({count})",
"jm/spn": "Redefinir",
- "+CwN9C": "Sistema",
- "dmW5bt": "Abra a URL de incorporação do painel privado em uma nova aba.",
- "PkGCG1": "Gere um link privado para experimentar a incorporação do painel.",
- "UcHF+A": "Link privado gerado",
- "6NIu/x": "Falha ao gerar link privado",
+ "+CwN9C": "",
+ "dmW5bt": "",
+ "PkGCG1": "",
+ "UcHF+A": "",
+ "6NIu/x": "",
"mBCW/X": "Incorporação do Painel",
- "QRvU5C": "Incorpore o painel de análise principal em outro site usando um link privado.",
- "Ygzo5N": "Link privado",
- "KOXkeN": "As incorporações de painel requerem um link privado. Qualquer pessoa com a URL do iframe pode visualizar o painel somente leitura.",
- "PRAz+o": "Link privado habilitado",
+ "QRvU5C": "",
+ "Ygzo5N": "",
+ "KOXkeN": "",
+ "PRAz+o": "",
"Pe0ogR": "Tema",
- "WNF1J6": "Escolha como o dashboard incorporado é exibido.",
+ "WNF1J6": "",
"FsIP28": "Ocultar barra lateral",
"dZAp5K": "Apenas a página principal do painel pode ser visualizada nesta incorporação.",
- "oJEVob": "Experimente",
+ "oJEVob": "",
"JfG49w": "Aberta",
"TJo5E6": "Pré-visualização",
- "0uO8I3": "Gerar um link privado para visualizar",
+ "0uO8I3": "",
"CHzo7t": "Código de Incorporação",
"m4+mLq": "Últimos 30 minutos",
"8O9cAb": "Últimas 24 horas",
@@ -1294,7 +1301,9 @@
"dcLGy5": "Exibe os 5 principais países que visitam seu site.",
"Eq9gxg": "Largura (px)",
"l3J5rs": "Largura do iframe. Use max-width: 100% para layouts responsivos.",
+ "2YpSsF": "",
"VKppxp": "O domínio não pode estar vazio",
+ "HtTwhf": "",
"69jzMr": "Domínio atualizado com sucesso",
"gwATc0": "Falha ao atualizar domínio",
"mNRvgY": "Site excluído com sucesso",
@@ -1316,6 +1325,7 @@
"lnIbba": "Rastreamento de endereço IP desativado",
"DQO/Q8": "Nome do site",
"7IM0G6": "O nome de exibição deste site",
+ "zoRFJV": "",
"I7l2wK": "O domínio usado para rastreamento",
"asd4Px": "Privacidade e Segurança",
"gI1OXG": "Excluir Site",
@@ -1370,6 +1380,8 @@
"biJyKp": "Exclua tráfego de endereços IP ou faixas específicas. Suporta IPs únicos (192.168.1.1), notação CIDR (192.168.1.0/24) e faixas (192.168.1.1-192.168.1.10).",
"tH8S0d": "Adicionar IP",
"pTHVrx": "Máximo de 100 exclusões de IP permitidas",
+ "pm+3nT": "",
+ "0Q1jqR": "",
"WFlQVv": "Script de Rastreamento",
"EGPr1w": "Adicione este script ao {headTag} do seu site",
"NPL5hM": "Padrões de Exclusão",
@@ -1405,7 +1417,9 @@
"YluXPL": "Incluir parâmetros de query string no rastreamento de página",
"kehGIT": "Rastreamento de parâmetros de URL ativado",
"LIX+6S": "Rastreamento de parâmetros de URL desativado",
+ "8s+sTd": "",
"fWblDI": "Visualização de Página Inicial",
+ "495/Ut": "",
"ciDaNU": "Rastreie automaticamente a primeira visualização de página quando o script carrega",
"KzO2sB": "Rastreamento de visualização de página inicial ativado",
"FcSY6x": "Rastreamento de visualização de página inicial desativado",
@@ -1413,6 +1427,7 @@
"mFg4Ag": "Rastreamento de saída ativado",
"sbjdWu": "Rastreamento de saída desativado",
"5zGub0": "Rastreamento de Erros",
+ "lxHUeO": "",
"4nfQk6": "Capture erros e exceções JavaScript do seu site",
"7LjSrf": "Rastreamento de erros desativado",
"u013P/": "Rastreie automaticamente cliques em todos os botões",
diff --git a/client/messages/uk.json b/client/messages/uk.json
index 12e2ffc3f..c3b9a45f7 100644
--- a/client/messages/uk.json
+++ b/client/messages/uk.json
@@ -66,6 +66,7 @@
"tL4WC1": "Завантаження...",
"HPx76n": "Всі елементи завантажено",
"QkTyho": "Бічна панель Rybbit",
+ "erYzJH": "",
"bnhHP6": "Вебаналітика",
"EFTSMc": "Головна",
"EYNe7E": "Глобус",
@@ -87,7 +88,7 @@
"D3idYv": "Налаштування",
"yMG/h7": "Налаштування сайту",
"yBqtD8": "{count} сеансів (24 год)",
- "MzI/h2": "Додати вебсайт",
+ "FIKvUB": "",
"Yxwqz8": "Сайт не вибрано",
"Gpwv5L": "Звіт у PDF завантажено",
"zJPmwX": "Не вдалося згенерувати звіт у PDF",
@@ -328,10 +329,10 @@
"Lu6+QS": "",
"qdOqu/": "",
"tGuKrF": "",
- "W6nwjo": "Чернетка",
"LHF3Za": "",
- "47FYwb": "Скасувати",
+ "W6nwjo": "Чернетка",
"rbrahO": "Закрити",
+ "47FYwb": "Скасувати",
"cyR7Kh": "",
"TiR/Hq": "Збереження...",
"mRL9Vh": "Створення...",
@@ -354,8 +355,8 @@
"l94vPo": "",
"qQTwNl": "",
"IuPATc": "",
- "W1QsrY": "",
"UBQJK/": "",
+ "W1QsrY": "",
"4IJvOg": "",
"iHip8n": "",
"kNp7lL": "",
@@ -593,6 +594,7 @@
"nGQuNF": "Сторінок за сеанс",
"yunf47": "Тривалість сеансу",
"MnpyfA": "Унікальні користувачі",
+ "kgLyso": "",
"RumeRz": "Регіони",
"IFkDw5": "Міста",
"GsBRWL": "Мови",
@@ -831,17 +833,21 @@
"rDEYPT": "Виберіть організацію, з якої потрібно видалити {email}. Вони втратять доступ до всіх ресурсів у цій організації.",
"3Vr8ps": "Панель адміністратора",
"KI5ndC": "Недійсний формат домену. Має бути дійсний домен, наприклад, example.com або sub.example.com",
+ "KI57sV": "",
"cGNlRB": "Перейдіть на тариф Pro, щоб додати більше вебсайтів",
"UpxSPM": "Вам потрібна активна підписка, щоб додавати вебсайти",
"Ymfrjv": "Ви досягли ліміту у {limit} вебсайтів. Оновіть тарифний план, щоб додати більше",
- "m5aC6r": "Відстежуйте аналітику для нового вебсайту у вашій організації",
+ "AZEGID": "",
+ "JkLHGw": "",
+ "CXI0EW": "",
"oAFgOq": "Домен",
+ "VQxsRK": "",
"3ARIAn": "Відображувана назва (за замовчуванням — домен)",
"fcj5H7": "Публічна аналітика",
"qQ21OF": "Коли увімкнено, будь-хто зможе переглядати аналітику без входу в систему",
"u/sVSP": "Увімкнути додавання солі до ID користувачів (Salting)",
"yGxRRq": "Підвищує конфіденційність за допомогою щоденної ротації солі для ідентифікаторів користувачів",
- "9ozcJb": "Помилка додавання вебсайту",
+ "W35dz6": "",
"u6kSOz": "Подобається Rybbit? Розгляньте можливість стати спонсором проєкту!",
"IDklh3": "Спонсорувати",
"c/KktL": "Ресурси",
@@ -888,6 +894,7 @@
"97KPX7": "Тегів не знайдено.",
"8Nc/jD": "Вебсайтів ще немає",
"nhaiN+": "Додайте свій перший вебсайт, щоб почати відстежувати аналітику",
+ "MzI/h2": "Додати вебсайт",
"/dxF+k": "Пароль має містити щонайменше 8 символів",
"6bxWvN": "Пароль успішно скинуто",
"yAAjri": "Введіть код OTP",
@@ -1294,7 +1301,9 @@
"dcLGy5": "",
"Eq9gxg": "",
"l3J5rs": "",
+ "2YpSsF": "",
"VKppxp": "Домен не може бути порожнім",
+ "HtTwhf": "",
"69jzMr": "Домен успішно оновлено",
"gwATc0": "Не вдалося оновити домен",
"mNRvgY": "Сайт успішно видалено",
@@ -1316,6 +1325,7 @@
"lnIbba": "Відстеження IP-адреси вимкнено",
"DQO/Q8": "Назва сайту",
"7IM0G6": "Відображувана назва для цього сайту",
+ "zoRFJV": "",
"I7l2wK": "Домен, що використовується для відстеження",
"asd4Px": "Конфіденційність та безпека",
"gI1OXG": "Видалити сайт",
@@ -1370,6 +1380,8 @@
"biJyKp": "Виключіть трафік із певних IP-адрес або діапазонів. Підтримуються окремі IP (192.168.1.1), нотація CIDR (192.168.1.0/24) та діапазони (192.168.1.1-192.168.1.10).",
"tH8S0d": "Додати IP",
"pTHVrx": "Дозволено максимум 100 винятків IP",
+ "pm+3nT": "",
+ "0Q1jqR": "",
"WFlQVv": "Скрипт відстеження",
"EGPr1w": "Додайте цей скрипт у тег {headTag} вашого вебсайту",
"NPL5hM": "Шаблони для пропуску",
@@ -1405,7 +1417,9 @@
"YluXPL": "Включати параметри рядка запиту у відстеження сторінок",
"kehGIT": "Відстеження параметрів URL увімкнено",
"LIX+6S": "Відстеження параметрів URL вимкнено",
+ "8s+sTd": "",
"fWblDI": "Початковий перегляд сторінки",
+ "495/Ut": "",
"ciDaNU": "Автоматично відстежувати перший перегляд сторінки під час завантаження скрипта",
"KzO2sB": "Відстеження початкового перегляду сторінки увімкнено",
"FcSY6x": "Відстеження початкового перегляду сторінки вимкнено",
@@ -1413,6 +1427,7 @@
"mFg4Ag": "Відстеження вихідних посилань увімкнено",
"sbjdWu": "Відстеження вихідних посилань вимкнено",
"5zGub0": "Відстеження помилок",
+ "lxHUeO": "",
"4nfQk6": "Фіксуйте помилки JavaScript та винятки з вашого сайту",
"7LjSrf": "Відстеження помилок вимкнено",
"u013P/": "Автоматично відстежувати кліки по всіх кнопках",
diff --git a/client/messages/zh.json b/client/messages/zh.json
index 9d6c58526..7c15104c0 100644
--- a/client/messages/zh.json
+++ b/client/messages/zh.json
@@ -66,12 +66,13 @@
"tL4WC1": "正在加载更多...",
"HPx76n": "所有项目已加载",
"QkTyho": "Rybbit 侧边栏",
+ "erYzJH": "",
"bnhHP6": "网络分析",
"EFTSMc": "主要",
"EYNe7E": "地球",
"CxfKLC": "页面",
"AA5h7P": "性能",
- "LlNItA": "机器人",
+ "LlNItA": "",
"XHLYdJ": "目标",
"9d/EEp": "产品分析",
"5yUsUe": "会话回放",
@@ -87,7 +88,7 @@
"D3idYv": "设置",
"yMG/h7": "网站设置",
"yBqtD8": "{count} 个会话 (24小时)",
- "MzI/h2": "添加网站",
+ "FIKvUB": "",
"Yxwqz8": "未选择网站",
"Gpwv5L": "PDF 报告已下载",
"zJPmwX": "生成 PDF 报告失败",
@@ -328,10 +329,10 @@
"Lu6+QS": "",
"qdOqu/": "",
"tGuKrF": "",
- "W6nwjo": "草稿",
"LHF3Za": "",
- "47FYwb": "取消",
+ "W6nwjo": "草稿",
"rbrahO": "关闭",
+ "47FYwb": "取消",
"cyR7Kh": "",
"TiR/Hq": "正在保存...",
"mRL9Vh": "正在创建...",
@@ -354,8 +355,8 @@
"l94vPo": "",
"qQTwNl": "",
"IuPATc": "",
- "W1QsrY": "",
"UBQJK/": "",
+ "W1QsrY": "",
"4IJvOg": "",
"iHip8n": "",
"kNp7lL": "",
@@ -593,6 +594,7 @@
"nGQuNF": "每次会话页数",
"yunf47": "会话时长",
"MnpyfA": "独立用户数",
+ "kgLyso": "",
"RumeRz": "地区",
"IFkDw5": "城市",
"GsBRWL": "语言",
@@ -831,17 +833,21 @@
"rDEYPT": "选择要从中移除 {email} 的组织。他们将失去对该组织中所有资源的访问权限。",
"3Vr8ps": "管理仪表板",
"KI5ndC": "无效的域名格式。必须是有效的域名,例如 example.com 或 sub.example.com",
+ "KI57sV": "",
"cGNlRB": "升级至 Pro 以添加更多网站",
"UpxSPM": "您需要有一个有效的订阅才能添加网站",
"Ymfrjv": "您已达到 {limit} 个网站的上限。请升级以添加更多网站",
- "m5aC6r": "为组织中的新网站跟踪分析数据",
+ "AZEGID": "",
+ "JkLHGw": "",
+ "CXI0EW": "",
"oAFgOq": "域名",
+ "VQxsRK": "",
"3ARIAn": "显示名称(默认为域名)",
"fcj5H7": "公开分析",
"qQ21OF": "启用后,任何人都可以查看分析数据而无需登录",
"u/sVSP": "启用用户 ID 加盐",
"yGxRRq": "通过每日轮换用户 ID 的盐值来增强隐私",
- "9ozcJb": "添加网站出错",
+ "W35dz6": "",
"u6kSOz": "喜欢 Rybbit 吗?考虑赞助这个项目!",
"IDklh3": "赞助我们",
"c/KktL": "资源",
@@ -888,6 +894,7 @@
"97KPX7": "未找到标签。",
"8Nc/jD": "还没有网站",
"nhaiN+": "添加您的第一个网站以开始跟踪分析",
+ "MzI/h2": "添加网站",
"/dxF+k": "密码长度必须至少为 8 个字符",
"6bxWvN": "密码重置成功",
"yAAjri": "输入 OTP 验证码",
@@ -1255,24 +1262,24 @@
"f3ocee": "排除来自特定国家/地区的流量。来自这些国家/地区的事件将不会在您的分析中被跟踪。",
"ItR6u3": "已排除的国家/地区 ({count})",
"jm/spn": "重置",
- "+CwN9C": "系统",
- "dmW5bt": "在新标签页中打开私密仪表板嵌入 URL。",
- "PkGCG1": "生成私密链接以试用仪表板嵌入。",
- "UcHF+A": "私密链接已生成",
- "6NIu/x": "生成私密链接失败",
+ "+CwN9C": "",
+ "dmW5bt": "",
+ "PkGCG1": "",
+ "UcHF+A": "",
+ "6NIu/x": "",
"mBCW/X": "仪表板嵌入",
- "QRvU5C": "使用私密链接将主要分析仪表板嵌入到其他网站。",
- "Ygzo5N": "私密链接",
- "KOXkeN": "仪表板嵌入需要私密链接。任何拥有 iframe URL 的人都可以查看只读仪表板。",
- "PRAz+o": "私密链接已启用",
+ "QRvU5C": "",
+ "Ygzo5N": "",
+ "KOXkeN": "",
+ "PRAz+o": "",
"Pe0ogR": "主题",
- "WNF1J6": "选择嵌入式仪表板的显示方式。",
+ "WNF1J6": "",
"FsIP28": "隐藏侧边栏",
"dZAp5K": "此嵌入只能查看主仪表板页面。",
- "oJEVob": "立即体验",
+ "oJEVob": "",
"JfG49w": "未结",
"TJo5E6": "预览",
- "0uO8I3": "生成私密链接以预览",
+ "0uO8I3": "",
"CHzo7t": "嵌入代码",
"m4+mLq": "过去 30 分钟",
"8O9cAb": "过去 24 小时",
@@ -1294,7 +1301,9 @@
"dcLGy5": "显示访问您站点的前 5 个国家/地区。",
"Eq9gxg": "宽度 (像素)",
"l3J5rs": "Iframe 宽度。使用 max-width: 100% 实现响应式布局。",
+ "2YpSsF": "",
"VKppxp": "域名不能为空",
+ "HtTwhf": "",
"69jzMr": "域名更新成功",
"gwATc0": "更新域名失败",
"mNRvgY": "网站删除成功",
@@ -1316,6 +1325,7 @@
"lnIbba": "IP 地址跟踪已禁用",
"DQO/Q8": "网站名称",
"7IM0G6": "此网站的显示名称",
+ "zoRFJV": "",
"I7l2wK": "用于跟踪的域名",
"asd4Px": "隐私与安全",
"gI1OXG": "删除网站",
@@ -1370,6 +1380,8 @@
"biJyKp": "排除来自特定 IP 地址或网段的流量。支持单个 IP (192.168.1.1)、CIDR 表示法 (192.168.1.0/24) 和范围 (192.168.1.1-192.168.1.10)。",
"tH8S0d": "添加 IP",
"pTHVrx": "最多允许 100 个 IP 排除项",
+ "pm+3nT": "",
+ "0Q1jqR": "",
"WFlQVv": "跟踪脚本",
"EGPr1w": "将此脚本添加到您网站的 {headTag} 中",
"NPL5hM": "跳过模式",
@@ -1405,7 +1417,9 @@
"YluXPL": "在页面跟踪中包含查询字符串参数",
"kehGIT": "URL 参数跟踪已启用",
"LIX+6S": "URL 参数跟踪已禁用",
+ "8s+sTd": "",
"fWblDI": "初始页面浏览",
+ "495/Ut": "",
"ciDaNU": "脚本加载时自动跟踪第一次页面浏览",
"KzO2sB": "初始页面浏览跟踪已启用",
"FcSY6x": "初始页面浏览跟踪已禁用",
@@ -1413,6 +1427,7 @@
"mFg4Ag": "出站跟踪已启用",
"sbjdWu": "出站跟踪已禁用",
"5zGub0": "错误追踪",
+ "lxHUeO": "",
"4nfQk6": "捕获网站中的 JavaScript 错误和异常",
"7LjSrf": "错误追踪已禁用",
"u013P/": "自动追踪所有按钮的点击",
diff --git a/client/next.config.ts b/client/next.config.ts
index 1f15b9500..96a8d8bf9 100644
--- a/client/next.config.ts
+++ b/client/next.config.ts
@@ -19,6 +19,7 @@ const nextConfig: NextConfig = {
env: {
NEXT_PUBLIC_BACKEND_URL: process.env.NEXT_PUBLIC_BACKEND_URL,
NEXT_PUBLIC_DISABLE_SIGNUP: process.env.NEXT_PUBLIC_DISABLE_SIGNUP,
+ NEXT_PUBLIC_LITE_DASHBOARD: process.env.NEXT_PUBLIC_LITE_DASHBOARD,
NEXT_PUBLIC_APP_VERSION: process.env.npm_package_version,
},
};
diff --git a/client/src/api/admin/endpoints/adminSites.ts b/client/src/api/admin/endpoints/adminSites.ts
index 583ce0dd2..d5fd57973 100644
--- a/client/src/api/admin/endpoints/adminSites.ts
+++ b/client/src/api/admin/endpoints/adminSites.ts
@@ -3,6 +3,7 @@ import { authedFetch } from "../../utils";
export interface AdminSiteData {
siteId: number;
name: string;
+ type: "web" | "mobile" | null;
domain: string;
createdAt: string;
public: boolean;
diff --git a/client/src/api/admin/endpoints/index.ts b/client/src/api/admin/endpoints/index.ts
index 19ebbf874..0ab76df56 100644
--- a/client/src/api/admin/endpoints/index.ts
+++ b/client/src/api/admin/endpoints/index.ts
@@ -15,11 +15,13 @@ export type { SiteResponse, GetSitesFromOrgResponse, VerifyScriptResponse } from
export {
getUserOrganizations,
addUserToOrganization,
+ createUserInOrganization,
USER_ORGANIZATIONS_QUERY_KEY,
} from "./organizations";
export type {
UserOrganization,
AddUserToOrganizationInput,
+ CreateUserInOrganizationInput,
RemoveUserFromOrganizationInput,
} from "./organizations";
diff --git a/client/src/api/admin/endpoints/organizations.ts b/client/src/api/admin/endpoints/organizations.ts
index 518ea31d1..f91116634 100644
--- a/client/src/api/admin/endpoints/organizations.ts
+++ b/client/src/api/admin/endpoints/organizations.ts
@@ -32,6 +32,26 @@ export function addUserToOrganization({ email, role, organizationId }: AddUserTo
});
}
+export interface CreateUserInOrganizationInput {
+ email: string;
+ name?: string;
+ password: string;
+ role: string;
+ organizationId: string;
+}
+
+export function createUserInOrganization({ email, name, password, role, organizationId }: CreateUserInOrganizationInput) {
+ return authedFetch<{ message: string }>(`/organizations/${organizationId}/users`, undefined, {
+ method: "POST",
+ data: {
+ email,
+ name,
+ password,
+ role,
+ },
+ });
+}
+
export interface RemoveUserFromOrganizationInput {
memberIdOrEmail: string;
organizationId: string;
diff --git a/client/src/api/admin/endpoints/sites.ts b/client/src/api/admin/endpoints/sites.ts
index d278fd893..e045a3e35 100644
--- a/client/src/api/admin/endpoints/sites.ts
+++ b/client/src/api/admin/endpoints/sites.ts
@@ -4,6 +4,7 @@ export type SiteResponse = {
id: string | null;
siteId: number;
name: string;
+ type: "web" | "mobile" | null;
domain: string;
createdAt: string;
updatedAt: string;
@@ -45,6 +46,7 @@ export type GetSitesFromOrgResponse = {
id: string | null;
siteId: number;
name: string;
+ type: "web" | "mobile" | null;
domain: string;
createdAt: string;
updatedAt: string;
@@ -76,6 +78,7 @@ export function addSite(
name: string,
organizationId: string,
settings?: {
+ type?: "web" | "mobile";
isPublic?: boolean;
saltUserIds?: boolean;
blockBots?: boolean;
@@ -86,6 +89,7 @@ export function addSite(
data: {
domain,
name,
+ type: settings?.type || "web",
public: settings?.isPublic || false,
saltUserIds: settings?.saltUserIds || false,
blockBots: settings?.blockBots === undefined ? true : settings?.blockBots,
@@ -107,6 +111,7 @@ export function updateSiteConfig(
siteId: number,
config: {
name?: string;
+ type?: "web" | "mobile" | null;
domain?: string;
public?: boolean;
embedEnabled?: boolean;
@@ -121,6 +126,7 @@ export function updateSiteConfig(
trackUrlParams?: boolean;
trackInitialPageView?: boolean;
trackSpaNavigation?: boolean;
+ trackIp?: boolean;
trackButtonClicks?: boolean;
trackCopy?: boolean;
trackFormInteractions?: boolean;
diff --git a/client/src/api/admin/hooks/useOrganizations.ts b/client/src/api/admin/hooks/useOrganizations.ts
index 656a1bb70..c61d85acb 100644
--- a/client/src/api/admin/hooks/useOrganizations.ts
+++ b/client/src/api/admin/hooks/useOrganizations.ts
@@ -3,8 +3,10 @@ import { authClient } from "../../../lib/auth";
import {
getUserOrganizations,
addUserToOrganization,
+ createUserInOrganization,
USER_ORGANIZATIONS_QUERY_KEY,
AddUserToOrganizationInput,
+ CreateUserInOrganizationInput,
RemoveUserFromOrganizationInput,
} from "../endpoints";
@@ -55,6 +57,26 @@ export function useAddUserToOrganization() {
});
}
+export function useCreateUserInOrganization() {
+ const queryClient = useQueryClient();
+
+ return useMutation<{ message: string }, Error, CreateUserInOrganizationInput>({
+ mutationFn: async (input: CreateUserInOrganizationInput) => {
+ try {
+ return await createUserInOrganization(input);
+ } catch (error) {
+ throw new Error(error instanceof Error ? error.message : "Failed to create user");
+ }
+ },
+ onSuccess: () => {
+ queryClient.invalidateQueries({ queryKey: ["admin-organizations"] });
+ queryClient.invalidateQueries({ queryKey: [USER_ORGANIZATIONS_QUERY_KEY] });
+ queryClient.invalidateQueries({ queryKey: ["admin-users"] });
+ queryClient.invalidateQueries({ queryKey: ["organization-members"] });
+ },
+ });
+}
+
export function useRemoveUserFromOrganization() {
const queryClient = useQueryClient();
diff --git a/client/src/api/analytics/endpoints/index.ts b/client/src/api/analytics/endpoints/index.ts
index 7bf4b41cf..61fd9ee1b 100644
--- a/client/src/api/analytics/endpoints/index.ts
+++ b/client/src/api/analytics/endpoints/index.ts
@@ -2,7 +2,15 @@
export * from "./types";
// Overview endpoints
-export { fetchOverview, fetchOverviewBucketed, fetchMetric, fetchLiveUserCount } from "./overview";
+export {
+ fetchOverview,
+ fetchOverviewBucketed,
+ fetchMetric,
+ fetchLiveUserCount,
+ fetchOverviewLite,
+ fetchOverviewBucketedLite,
+ fetchMetricLite,
+} from "./overview";
export type {
GetOverviewResponse,
GetOverviewBucketedResponse,
diff --git a/client/src/api/analytics/endpoints/overview.ts b/client/src/api/analytics/endpoints/overview.ts
index a23c53ae3..f5aa13ff5 100644
--- a/client/src/api/analytics/endpoints/overview.ts
+++ b/client/src/api/analytics/endpoints/overview.ts
@@ -105,3 +105,47 @@ export async function fetchLiveUserCount(
);
return response;
}
+
+/**
+ * Fetch lite overview (MV-backed, no filters).
+ * GET /api/sites/:site/overview-lite
+ */
+export async function fetchOverviewLite(
+ site: string | number,
+ params: CommonApiParams
+): Promise<GetOverviewResponse> {
+ const response = await authedFetch<{ data: GetOverviewResponse }>(
+ `/sites/${site}/overview-lite`,
+ toQueryParams(params)
+ );
+ return response.data;
+}
+
+/**
+ * Fetch lite bucketed overview (MV-backed).
+ * GET /api/sites/:site/overview-bucketed-lite
+ */
+export async function fetchOverviewBucketedLite(
+ site: string | number,
+ params: BucketedParams
+): Promise<GetOverviewBucketedResponse> {
+ const response = await authedFetch<{ data: GetOverviewBucketedResponse }>(
+ `/sites/${site}/overview-bucketed-lite`,
+ toBucketedQueryParams(params)
+ );
+ return response.data;
+}
+
+/**
+ * Fetch lite metric (MV-backed). Supports pathname, country, and device type.
+ * GET /api/sites/:site/metric-lite
+ */
+export async function fetchMetricLite(
+ site: string | number,
+ params: MetricParams
+): Promise<{ data: MetricResponse[]; totalCount: number }> {
+ const response = await authedFetch<{
+ data: { data: MetricResponse[]; totalCount: number };
+ }>(`/sites/${site}/metric-lite`, toMetricQueryParams(params));
+ return response.data;
+}
diff --git a/client/src/api/analytics/hooks/useGetMetric.ts b/client/src/api/analytics/hooks/useGetMetric.ts
index e0eeb6211..64b0e59ee 100644
--- a/client/src/api/analytics/hooks/useGetMetric.ts
+++ b/client/src/api/analytics/hooks/useGetMetric.ts
@@ -10,7 +10,7 @@ import { useStore } from "../../../lib/store";
import { APIResponse } from "../../types";
import { buildApiParams } from "../../utils";
import { Time } from "../../../components/DateSelector/types";
-import { fetchMetric, MetricResponse } from "../endpoints";
+import { fetchMetric, fetchMetricLite, MetricResponse } from "../endpoints";
type PeriodTime = "current" | "previous";
@@ -80,6 +80,7 @@ export function usePaginatedMetric({
additionalFilters = [],
customFilters = [],
customTime,
+ lite = false,
}: {
parameter: FilterParameter;
limit?: number;
@@ -89,9 +90,12 @@ export function usePaginatedMetric({
additionalFilters?: Filter[];
customFilters?: Filter[];
customTime?: Time;
+ lite?: boolean;
}): UseQueryResult<PaginatedResponse> {
const { time, site, filters, timezone } = useStore();
const timeToUse = customTime ?? time;
+ // Lite endpoints forward filters too — the server falls back to raw events
+ // when a filter is active. `lite` only selects the fetcher, not the filters.
const combinedFilters = useFilters
? customFilters.length > 0
? customFilters
@@ -101,9 +105,10 @@ export function usePaginatedMetric({
const params = buildApiParams(timeToUse, { filters: combinedFilters });
return useQuery({
- queryKey: [parameter, customTime, time, site, filters, limit, page, additionalFilters, customFilters, timezone],
+ queryKey: [parameter, customTime, time, site, filters, limit, page, additionalFilters, customFilters, timezone, lite],
queryFn: async () => {
- return fetchMetric(site, {
+ const fetcher = lite ? fetchMetricLite : fetchMetric;
+ return fetcher(site, {
...params,
parameter,
limit,
@@ -132,6 +137,7 @@ export function useInfiniteMetric({
additionalFilters = [],
customFilters = [],
customTime,
+ lite = false,
}: {
parameter: FilterParameter;
limit?: number;
@@ -139,9 +145,12 @@ export function useInfiniteMetric({
additionalFilters?: Filter[];
customFilters?: Filter[];
customTime?: Time;
+ lite?: boolean;
}): UseInfiniteQueryResult<InfiniteData<PaginatedResponse>> {
const { time, site, filters, timezone } = useStore();
const timeToUse = customTime ?? time;
+ // Lite endpoints forward filters too — the server falls back to raw events
+ // when a filter is active. `lite` only selects the fetcher, not the filters.
const combinedFilters = useFilters
? customFilters.length > 0
? customFilters
@@ -161,9 +170,11 @@ export function useInfiniteMetric({
customFilters,
"infinite-metric",
timezone,
+ lite,
],
queryFn: async ({ pageParam = 1 }) => {
- return fetchMetric(site, {
+ const fetcher = lite ? fetchMetricLite : fetchMetric;
+ return fetcher(site, {
...params,
parameter,
limit,
diff --git a/client/src/api/analytics/hooks/useGetOverview.ts b/client/src/api/analytics/hooks/useGetOverview.ts
index 3485b3299..b59a03e3c 100644
--- a/client/src/api/analytics/hooks/useGetOverview.ts
+++ b/client/src/api/analytics/hooks/useGetOverview.ts
@@ -2,7 +2,7 @@ import { useQuery } from "@tanstack/react-query";
import { Time } from "../../../components/DateSelector/types";
import { useStore } from "../../../lib/store";
import { buildApiParams } from "../../utils";
-import { fetchOverview } from "../endpoints";
+import { fetchOverview, fetchOverviewLite } from "../endpoints";
type PeriodTime = "current" | "previous";
@@ -11,9 +11,11 @@ type UseGetOverviewOptions = {
site?: number | string;
overrideTime?: Time;
useFilters?: boolean;
+ // Read the MV-backed lite endpoint instead of the raw-events one.
+ lite?: boolean;
};
-export function useGetOverview({ periodTime, site, overrideTime, useFilters = true }: UseGetOverviewOptions) {
+export function useGetOverview({ periodTime, site, overrideTime, useFilters = true, lite = false }: UseGetOverviewOptions) {
const { time, previousTime, filters, timezone } = useStore();
// Use overrideTime if provided, otherwise use store time
@@ -21,12 +23,13 @@ export function useGetOverview({ periodTime, site, overrideTime, useFilters = tr
const timeToUse = periodTime === "previous" ? previousTime : baseTime;
const params = buildApiParams(timeToUse, { filters: useFilters ? filters : undefined });
- const queryKey = ["overview", timeToUse, site, filters, useFilters, timezone];
+ const queryKey = ["overview", timeToUse, site, filters, useFilters, timezone, lite];
return useQuery({
queryKey,
queryFn: () => {
- return fetchOverview(site!, params).then(data => ({ data }));
+ const fetcher = lite ? fetchOverviewLite : fetchOverview;
+ return fetcher(site!, params).then(data => ({ data }));
},
staleTime: 60_000,
placeholderData: (_, query: any) => {
diff --git a/client/src/api/analytics/hooks/useGetOverviewBucketed.ts b/client/src/api/analytics/hooks/useGetOverviewBucketed.ts
index 622500961..db03fa8c2 100644
--- a/client/src/api/analytics/hooks/useGetOverviewBucketed.ts
+++ b/client/src/api/analytics/hooks/useGetOverviewBucketed.ts
@@ -4,7 +4,7 @@ import { Time } from "../../../components/DateSelector/types";
import { useStore } from "../../../lib/store";
import { APIResponse } from "../../types";
import { buildApiParams } from "../../utils";
-import { fetchOverviewBucketed, GetOverviewBucketedResponse } from "../endpoints";
+import { fetchOverviewBucketed, fetchOverviewBucketedLite, GetOverviewBucketedResponse } from "../endpoints";
type PeriodTime = "current" | "previous";
@@ -17,6 +17,7 @@ export function useGetOverviewBucketed({
overrideTime,
props,
useFilters = true,
+ lite = false,
}: {
periodTime?: PeriodTime;
site: number | string;
@@ -26,6 +27,8 @@ export function useGetOverviewBucketed({
overrideTime?: Time;
props?: Partial<UseQueryOptions<APIResponse<GetOverviewBucketedResponse>>>;
useFilters?: boolean;
+ // Read the MV-backed lite endpoint instead of the raw-events one.
+ lite?: boolean;
}): UseQueryResult<APIResponse<GetOverviewBucketedResponse>> {
const { time, previousTime, filters: globalFilters, timezone } = useStore();
@@ -46,15 +49,17 @@ export function useGetOverviewBucketed({
combinedFilters,
useFilters,
timezone,
+ lite,
]
- : ["overview-bucketed", timeToUse, bucket, site, combinedFilters, useFilters, timezone];
+ : ["overview-bucketed", timeToUse, bucket, site, combinedFilters, useFilters, timezone, lite];
const params = buildApiParams(timeToUse, { filters: combinedFilters });
return useQuery({
queryKey,
queryFn: () => {
- return fetchOverviewBucketed(site, { ...params, bucket }).then(data => ({ data }));
+ const fetcher = lite ? fetchOverviewBucketedLite : fetchOverviewBucketed;
+ return fetcher(site, { ...params, bucket }).then(data => ({ data }));
},
refetchInterval,
placeholderData: (_, query: any) => {
diff --git a/client/src/app/[site]/components/Sidebar/Sidebar.tsx b/client/src/app/[site]/components/Sidebar/Sidebar.tsx
index 1543f05cc..5c7dd48a8 100644
--- a/client/src/app/[site]/components/Sidebar/Sidebar.tsx
+++ b/client/src/app/[site]/components/Sidebar/Sidebar.tsx
@@ -39,6 +39,7 @@ function SidebarContent() {
const { embed, hideSidebar } = useEmbedPageOptions();
const { data: site } = useGetSite(Number(pathname.split("/")[1]));
+ const isMobileSite = site?.type === "mobile";
if (hideSidebar) return null;
@@ -70,7 +71,9 @@ function SidebarContent() {
<SiteSelector />
</div>
<div className="flex flex-col p-3 pt-1">
- <SidebarComponents.SectionHeader>{t("Web Analytics")}</SidebarComponents.SectionHeader>
+ <SidebarComponents.SectionHeader>
+ {isMobileSite ? t("App Analytics") : t("Web Analytics")}
+ </SidebarComponents.SectionHeader>
<SidebarComponents.Item
label={t("Main")}
active={isActiveTab("main")}
@@ -91,7 +94,7 @@ function SidebarContent() {
icon={<File className="w-4 h-4" />}
/>
)}
- {IS_CLOUD && (
+ {IS_CLOUD && !isMobileSite && (
<SidebarComponents.Item
label={t("Performance")}
active={isActiveTab("performance")}
@@ -123,7 +126,7 @@ function SidebarContent() {
</div>
<SidebarComponents.SectionHeader>{t("Product Analytics")}</SidebarComponents.SectionHeader>
<div className="hidden md:block">
- {!subscription?.planName?.startsWith("appsumo") && !isSubscriptionLoading && (
+ {!isMobileSite && !subscription?.planName?.startsWith("appsumo") && !isSubscriptionLoading && (
<SidebarComponents.Item
label={t("Replay")}
active={isActiveTab("replay")}
diff --git a/client/src/app/[site]/components/Sidebar/SiteSelector.tsx b/client/src/app/[site]/components/Sidebar/SiteSelector.tsx
index 9287826d1..56cfa5f52 100644
--- a/client/src/app/[site]/components/Sidebar/SiteSelector.tsx
+++ b/client/src/app/[site]/components/Sidebar/SiteSelector.tsx
@@ -135,7 +135,7 @@ function SiteSelectorContent({ onSiteSelect }: { onSiteSelect: () => void }) {
trigger={
<Button variant="ghost" className="w-full justify-start gap-2">
<Plus className="h-4 w-4" />
- {t("Add Website")}
+ {t("Add Site")}
</Button>
}
/>
diff --git a/client/src/app/[site]/components/shared/StandardSection/StandardSection.tsx b/client/src/app/[site]/components/shared/StandardSection/StandardSection.tsx
index bbcd06364..c1a16b68b 100644
--- a/client/src/app/[site]/components/shared/StandardSection/StandardSection.tsx
+++ b/client/src/app/[site]/components/shared/StandardSection/StandardSection.tsx
@@ -1,11 +1,12 @@
"use client";
import { Filter, FilterParameter } from "@rybbit/shared";
-import { Info } from "lucide-react";
+import { useIntersectionObserver } from "@uidotdev/usehooks";
+import { Info, Loader2 } from "lucide-react";
import { useExtracted } from "next-intl";
import Link from "next/link";
-import { ReactNode } from "react";
-import { usePaginatedMetric } from "../../../../../api/analytics/hooks/useGetMetric";
+import { ReactNode, useEffect, useMemo } from "react";
+import { useInfiniteMetric } from "../../../../../api/analytics/hooks/useGetMetric";
import { MetricResponse } from "../../../../../api/analytics/endpoints";
import { ErrorState } from "../../../../../components/ErrorState";
import { CardLoader } from "../../../../../components/ui/card";
@@ -17,8 +18,6 @@ import { StandardSkeleton } from "./Skeleton";
import { StandardSectionDialog } from "./StandardSectionDialog";
import { Time } from "../../../../../components/DateSelector/types";
-const MAX_ITEMS_TO_DISPLAY = 10;
-
export type StandardSectionBaseProps = {
title: string;
getKey: (item: MetricResponse) => string;
@@ -32,6 +31,7 @@ export type StandardSectionBaseProps = {
getSubrowLabel?: (item: MetricResponse) => ReactNode;
customFilters?: Filter[];
customTime?: Time;
+ lite?: boolean;
};
type StandardSectionProps = StandardSectionBaseProps & {
@@ -55,24 +55,41 @@ export function StandardSection({
getSubrowLabel,
customFilters,
customTime,
+ lite = false,
renderDialog = true,
}: StandardSectionProps) {
const t = useExtracted();
- const { data, isLoading, isFetching, error, refetch } = usePaginatedMetric({
- parameter: filterParameter,
- limit: 100,
- page: 1,
- customFilters,
- customTime,
+ const { data, isLoading, isFetching, error, refetch, fetchNextPage, hasNextPage, isFetchingNextPage } =
+ useInfiniteMetric({
+ parameter: filterParameter,
+ limit: 100,
+ customFilters,
+ customTime,
+ lite,
+ });
+
+ // Load more when the sentinel near the bottom of the scroll area becomes
+ // visible. root: null relies on IntersectionObserver respecting the
+ // ScrollArea viewport's clipping, matching the dialog's infinite scroll.
+ const [loadMoreRef, entry] = useIntersectionObserver({
+ threshold: 0,
+ root: null,
+ rootMargin: "0px 0px 200px 0px",
});
- const itemsForDisplay = data?.data;
+ const itemsForDisplay = useMemo(() => data?.pages.flatMap(page => page.data), [data]);
+
+ useEffect(() => {
+ if (entry?.isIntersecting && hasNextPage && !isFetchingNextPage && !isLoading) {
+ fetchNextPage();
+ }
+ }, [entry?.isIntersecting, fetchNextPage, hasNextPage, isFetchingNextPage, isLoading]);
const ratio = itemsForDisplay?.[0]?.percentage ? 100 / itemsForDisplay[0].percentage : 1;
return (
<>
- {isFetching && (
+ {isFetching && !isFetchingNextPage && (
<div className="absolute top-[-8px] left-0 w-full h-full">
<CardLoader />
</div>
@@ -131,6 +148,13 @@ export function StandardSection({
{t("No Data")}
</div>
)}
+ {itemsForDisplay?.length ? (
+ <div ref={loadMoreRef} className="flex justify-center py-1">
+ {isFetchingNextPage && (
+ <Loader2 className="h-4 w-4 animate-spin text-neutral-600 dark:text-neutral-400" />
+ )}
+ </div>
+ ) : null}
</>
)}
{renderDialog && close && !isLoading && !error && itemsForDisplay?.length ? (
@@ -148,6 +172,7 @@ export function StandardSection({
close={close}
customFilters={customFilters}
customTime={customTime}
+ lite={lite}
/>
</div>
) : null}
diff --git a/client/src/app/[site]/components/shared/StandardSection/StandardSectionDialog.tsx b/client/src/app/[site]/components/shared/StandardSection/StandardSectionDialog.tsx
index 141c516d5..5801a37d5 100644
--- a/client/src/app/[site]/components/shared/StandardSection/StandardSectionDialog.tsx
+++ b/client/src/app/[site]/components/shared/StandardSection/StandardSectionDialog.tsx
@@ -38,6 +38,7 @@ export interface StandardSectionDialogBodyProps {
filterParameter: FilterParameter;
customFilters?: Filter[];
customTime?: Time;
+ lite?: boolean;
}
interface StandardSectionDialogProps extends StandardSectionDialogBodyProps {
@@ -57,6 +58,7 @@ export function StandardSectionDialogBody({
filterParameter,
customFilters,
customTime,
+ lite = false,
}: StandardSectionDialogBodyProps) {
const t = useExtracted();
const { data, isLoading, isError, error, refetch, fetchNextPage, hasNextPage, isFetchingNextPage } =
@@ -65,6 +67,7 @@ export function StandardSectionDialogBody({
limit: 100,
customFilters,
customTime,
+ lite,
});
const [searchTerm, setSearchTerm] = useState("");
diff --git a/client/src/app/[site]/main/components/MainSection/MainSectionLite.tsx b/client/src/app/[site]/main/components/MainSection/MainSectionLite.tsx
new file mode 100644
index 000000000..fae734c0f
--- /dev/null
+++ b/client/src/app/[site]/main/components/MainSection/MainSectionLite.tsx
@@ -0,0 +1,67 @@
+"use client";
+import { Card, CardContent, CardLoader } from "@/components/ui/card";
+import { useExtracted } from "next-intl";
+import Link from "next/link";
+import { useGetOverviewBucketed } from "../../../../../api/analytics/hooks/useGetOverviewBucketed";
+import { BucketSelection } from "../../../../../components/BucketSelection";
+import { RybbitTextLogo } from "../../../../../components/RybbitLogo";
+import { useWhiteLabel } from "../../../../../hooks/useIsWhiteLabel";
+import { authClient } from "../../../../../lib/auth";
+import { useStore } from "../../../../../lib/store";
+import { Chart } from "./Chart";
+import { OverviewLite } from "./OverviewLite";
+
+// Lite variant of MainSection: drops the 2 previous-period queries and reads
+// MV-backed endpoints. Halves the query count for the top of the dashboard.
+export function MainSectionLite() {
+ const { isWhiteLabel } = useWhiteLabel();
+ const session = authClient.useSession();
+ const t = useExtracted();
+
+ const { selectedStat, site, bucket } = useStore();
+
+ const getSelectedStatLabel = () => {
+ switch (selectedStat) {
+ case "pageviews": return t("Pageviews");
+ case "sessions": return t("Sessions");
+ case "pages_per_session": return t("Pages per Session");
+ case "bounce_rate": return t("Bounce Rate");
+ case "session_duration": return t("Session Duration");
+ case "users": return t("Users");
+ default: return selectedStat;
+ }
+ };
+
+ const { data, isFetching } = useGetOverviewBucketed({ site, bucket, lite: true });
+
+ const max = Math.max(...(data?.data?.map((d: any) => d[selectedStat]) ?? []));
+
+ return (
+ <>
+ <Card>
+ <CardContent className="p-0 w-full">
+ <OverviewLite />
+ </CardContent>
+ </Card>
+ <Card>
+ {isFetching && <CardLoader />}
+ <CardContent className="p-2 md:p-4 py-3 w-full">
+ <div className="flex items-center justify-between px-2 md:px-0">
+ <div className="flex items-center space-x-4">
+ {!isWhiteLabel && (
+ <Link href={session.data ? "/" : "https://rybbit.com"} className="opacity-75">
+ <RybbitTextLogo width={80} height={0} />
+ </Link>
+ )}
+ </div>
+ <span className="text-sm text-neutral-700 dark:text-neutral-200">{getSelectedStatLabel()}</span>
+ <BucketSelection />
+ </div>
+ <div className="h-[200px] md:h-[290px] relative">
+ <Chart data={data} max={max} previousData={undefined} chartXMax={undefined} />
+ </div>
+ </CardContent>
+ </Card>
+ </>
+ );
+}
diff --git a/client/src/app/[site]/main/components/MainSection/OverviewLite.tsx b/client/src/app/[site]/main/components/MainSection/OverviewLite.tsx
new file mode 100644
index 000000000..46c8a5149
--- /dev/null
+++ b/client/src/app/[site]/main/components/MainSection/OverviewLite.tsx
@@ -0,0 +1,177 @@
+"use client";
+
+import { Skeleton } from "@/components/ui/skeleton";
+import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
+import { cn, formatSecondsAsMinutesAndSeconds } from "@/lib/utils";
+import NumberFlow from "@number-flow/react";
+import { useExtracted } from "next-intl";
+import { useState } from "react";
+import { useGetOverview } from "../../../../../api/analytics/hooks/useGetOverview";
+import { useGetOverviewBucketed } from "../../../../../api/analytics/hooks/useGetOverviewBucketed";
+import { StatType, useStore } from "../../../../../lib/store";
+import { SparklinesChart } from "./SparklinesChart";
+
+// Lite variant of Overview: no previous-period queries, no comparison arrows.
+// Backed by MV endpoints; ~10x fewer ClickHouse rows scanned per render.
+
+type LiteStatType = StatType | "total_time";
+
+const formatTotalTimeSpent = (value: number) => {
+ const seconds = Math.max(0, Math.round(value));
+ const days = Math.floor(seconds / 86400);
+ const hours = Math.floor((seconds % 86400) / 3600);
+ const minutes = Math.floor((seconds % 3600) / 60);
+
+ if (days > 0) return `${days}d ${hours}h`;
+ if (hours > 0) return `${hours}hr ${minutes}min`;
+ return formatSecondsAsMinutesAndSeconds(seconds);
+};
+
+const Stat = ({
+ title,
+ id,
+ value,
+ valueFormatter,
+ getBucketValue,
+ isLoading,
+ decimals,
+ postfix,
+}: {
+ title: string;
+ id: LiteStatType;
+ value: number;
+ valueFormatter?: (value: number) => string;
+ getBucketValue?: (bucket: any) => number;
+ isLoading: boolean;
+ decimals?: number;
+ postfix?: string;
+}) => {
+ const { selectedStat, setSelectedStat, site, bucket, time } = useStore();
+ const [isHovering, setIsHovering] = useState(false);
+ const isSelectable = id !== "total_time";
+
+ const { data } = useGetOverviewBucketed({ site, bucket, lite: true });
+
+ const sparklinesData =
+ data?.data
+ ?.filter(d => {
+ if (time.mode === "past-minutes") {
+ const timestamp = new Date(d.time);
+ const now = new Date();
+ const startTime = new Date(now.getTime() - time.pastMinutesStart * 60 * 1000);
+ return timestamp >= startTime && timestamp <= now;
+ }
+ return true;
+ })
+ .map((d: any) => ({
+ value: getBucketValue ? getBucketValue(d) : d[id],
+ time: d.time,
+ })) ?? [];
+
+ const handleClick = () => {
+ if (id !== "total_time") {
+ setSelectedStat(id);
+ }
+ };
+
+ return (
+ <div
+ className={cn(
+ "flex flex-col border-r border-neutral-100 dark:border-neutral-800 last:border-r-0 text-nowrap",
+ isSelectable ? "cursor-pointer" : "cursor-default",
+ isSelectable && selectedStat === id && "bg-neutral-0 dark:bg-neutral-850"
+ )}
+ onClick={handleClick}
+ onMouseEnter={() => setIsHovering(true)}
+ onMouseLeave={() => setIsHovering(false)}
+ >
+ <div className="flex flex-col px-3 py-2">
+ <div className="text-xs font-medium text-muted-foreground">{title}</div>
+ <div className="text-2xl font-medium flex gap-2 items-center justify-between">
+ {isLoading ? (
+ <Skeleton className="w-[60px] h-9 rounded-md" />
+ ) : valueFormatter ? (
+ valueFormatter(value)
+ ) : (
+ <span>
+ <Tooltip>
+ <TooltipTrigger>
+ <NumberFlow
+ respectMotionPreference={false}
+ value={decimals ? Number(value.toFixed(decimals)) : value}
+ format={{ notation: "compact" }}
+ />
+ </TooltipTrigger>
+ <TooltipContent>
+ <NumberFlow
+ respectMotionPreference={false}
+ value={decimals ? Number(value.toFixed(decimals)) : value}
+ format={{ notation: "standard" }}
+ />
+ {postfix && <span>{postfix}</span>}
+ </TooltipContent>
+ </Tooltip>
+ {postfix && <span>{postfix}</span>}
+ </span>
+ )}
+ </div>
+ </div>
+ <div className="h-[40px] -mt-4">
+ <SparklinesChart data={sparklinesData} isHovering={isHovering} />
+ </div>
+ </div>
+ );
+};
+
+export function OverviewLite() {
+ const { site } = useStore();
+ const t = useExtracted();
+
+ const { data: overviewData, isLoading } = useGetOverview({ site, lite: true });
+
+ const users = overviewData?.data?.users ?? 0;
+ const sessions = overviewData?.data?.sessions ?? 0;
+ const pageviews = overviewData?.data?.pageviews ?? 0;
+ const pagesPerSession = overviewData?.data?.pages_per_session ?? 0;
+ const bounceRate = overviewData?.data?.bounce_rate ?? 0;
+ const sessionDuration = overviewData?.data?.session_duration ?? 0;
+ const totalTimeSpent = sessionDuration * sessions;
+
+ return (
+ <div className="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-7 gap-0 items-center">
+ <Stat title={t("Unique Users")} id="users" value={users} isLoading={isLoading} />
+ <Stat title={t("Sessions")} id="sessions" value={sessions} isLoading={isLoading} />
+ <Stat title={t("Pageviews")} id="pageviews" value={pageviews} isLoading={isLoading} />
+ <Stat
+ title={t("Pages per Session")}
+ id="pages_per_session"
+ value={pagesPerSession}
+ decimals={1}
+ isLoading={isLoading}
+ />
+ <Stat
+ title={t("Bounce Rate")}
+ id="bounce_rate"
+ value={bounceRate}
+ isLoading={isLoading}
+ postfix="%"
+ decimals={1}
+ />
+ <Stat
+ title={t("Session Duration")}
+ id="session_duration"
+ value={sessionDuration}
+ isLoading={isLoading}
+ valueFormatter={formatSecondsAsMinutesAndSeconds}
+ />
+ <Stat
+ title={t("Total Time")}
+ id="total_time"
+ value={totalTimeSpent}
+ isLoading={isLoading}
+ valueFormatter={formatTotalTimeSpent}
+ getBucketValue={d => (d.session_duration ?? 0) * (d.sessions ?? 0)}
+ />
+ </div>
+ );
+}
diff --git a/client/src/app/[site]/main/components/sections/CountriesLite.tsx b/client/src/app/[site]/main/components/sections/CountriesLite.tsx
new file mode 100644
index 000000000..ef9f88283
--- /dev/null
+++ b/client/src/app/[site]/main/components/sections/CountriesLite.tsx
@@ -0,0 +1,37 @@
+"use client";
+
+import { useExtracted } from "next-intl";
+import { getCountryName } from "../../../../../lib/utils";
+import {
+ StandardSectionTabs,
+ type StandardSectionTab,
+} from "../../../components/shared/StandardSection/StandardSectionTabs";
+import { CountryFlag } from "../../../components/shared/icons/CountryFlag";
+
+// Lite Countries section: country only (regions/cities tabs require deeper
+// dimensions than the country MV stores).
+export function CountriesLite() {
+ const t = useExtracted();
+
+ const tabs: StandardSectionTab<"countries">[] = [
+ {
+ value: "countries",
+ label: t("Countries"),
+ section: {
+ filterParameter: "country",
+ title: t("Countries"),
+ getValue: e => e.value,
+ getKey: e => e.value,
+ getLabel: e => (
+ <div className="flex items-center gap-2">
+ <CountryFlag country={e.value} />
+ {getCountryName(e.value) || t("Unknown")}
+ </div>
+ ),
+ lite: true,
+ },
+ },
+ ];
+
+ return <StandardSectionTabs defaultValue="countries" tabs={tabs} />;
+}
diff --git a/client/src/app/[site]/main/components/sections/DevicesLite.tsx b/client/src/app/[site]/main/components/sections/DevicesLite.tsx
new file mode 100644
index 000000000..f3a62bfb1
--- /dev/null
+++ b/client/src/app/[site]/main/components/sections/DevicesLite.tsx
@@ -0,0 +1,35 @@
+"use client";
+
+import { useExtracted } from "next-intl";
+import {
+ StandardSectionTabs,
+ type StandardSectionTab,
+} from "../../../components/shared/StandardSection/StandardSectionTabs";
+import { DeviceIcon } from "../../../components/shared/icons/Device";
+
+// Lite Devices section: device type only.
+export function DevicesLite() {
+ const t = useExtracted();
+
+ const tabs: StandardSectionTab<"devices">[] = [
+ {
+ value: "devices",
+ label: t("Devices"),
+ section: {
+ filterParameter: "device_type",
+ title: t("Devices"),
+ getValue: e => e.value,
+ getKey: e => e.value,
+ getLabel: e => (
+ <div className="flex gap-2 items-center">
+ <DeviceIcon deviceType={e.value || ""} size={16} />
+ {e.value || t("Other")}
+ </div>
+ ),
+ lite: true,
+ },
+ },
+ ];
+
+ return <StandardSectionTabs defaultValue="devices" tabs={tabs} />;
+}
diff --git a/client/src/app/[site]/main/components/sections/PagesLite.tsx b/client/src/app/[site]/main/components/sections/PagesLite.tsx
new file mode 100644
index 000000000..f8c6ecde6
--- /dev/null
+++ b/client/src/app/[site]/main/components/sections/PagesLite.tsx
@@ -0,0 +1,37 @@
+"use client";
+
+import { useExtracted } from "next-intl";
+import { useGetSite } from "../../../../../api/admin/hooks/useSites";
+import { truncateString } from "../../../../../lib/utils";
+import {
+ StandardSectionTabs,
+ type StandardSectionTab,
+} from "../../../components/shared/StandardSection/StandardSectionTabs";
+
+// Lite Pages section: pathname only (no titles/entries/exits/hostnames tabs —
+// the MV is keyed on pathname).
+export function PagesLite() {
+ const { data: siteMetadata } = useGetSite();
+ const t = useExtracted();
+
+ const tabs: StandardSectionTab<"pages">[] = [
+ {
+ value: "pages",
+ label: t("Pages"),
+ section: {
+ filterParameter: "pathname",
+ title: t("Pages"),
+ getValue: e => e.value,
+ getKey: e => e.value,
+ getLabel: e => truncateString(e.value, 50) || t("Other"),
+ getLink: e => {
+ const host = e.hostname || siteMetadata?.domain;
+ return host ? `https://${host}${e.value}` : "#";
+ },
+ lite: true,
+ },
+ },
+ ];
+
+ return <StandardSectionTabs defaultValue="pages" tabs={tabs} />;
+}
diff --git a/client/src/app/[site]/main/page.tsx b/client/src/app/[site]/main/page.tsx
index 0b8a6d4ad..266d2766b 100644
--- a/client/src/app/[site]/main/page.tsx
+++ b/client/src/app/[site]/main/page.tsx
@@ -3,14 +3,18 @@ import { ReactNode } from "react";
import { useGetLiveUserCount } from "../../../api/analytics/hooks/useGetLiveUserCount";
import { useInView } from "../../../hooks/useInView";
import { useSetPageTitle } from "../../../hooks/useSetPageTitle";
-import { IS_CLOUD } from "../../../lib/const";
+import { IS_CLOUD, LITE_DASHBOARD } from "../../../lib/const";
import { useStore } from "../../../lib/store";
import { SubHeader } from "../components/SubHeader/SubHeader";
import { MainSection } from "./components/MainSection/MainSection";
+import { MainSectionLite } from "./components/MainSection/MainSectionLite";
import { Countries } from "./components/sections/Countries";
+import { CountriesLite } from "./components/sections/CountriesLite";
import { Devices } from "./components/sections/Devices";
+import { DevicesLite } from "./components/sections/DevicesLite";
import { Events } from "./components/sections/Events";
import { Pages } from "./components/sections/Pages";
+import { PagesLite } from "./components/sections/PagesLite";
import { Referrers } from "./components/sections/Referrers";
import { SearchConsole } from "./components/sections/SearchConsole";
import { Weekdays } from "./components/sections/Weekdays";
@@ -39,18 +43,57 @@ function MainPageContent() {
useSetPageTitle(`${data?.count ?? "…"} user${data?.count === 1 ? "" : "s"} online`);
+ if (LITE_DASHBOARD) {
+ return (
+ <div className="p-2 md:p-4 max-w-[1100px] mx-auto space-y-3">
+ <SubHeader />
+ <MainSectionLite />
+ <div className="grid grid-cols-1 lg:grid-cols-2 gap-3 mt-3">
+ <LazySection>
+ <PagesLite />
+ </LazySection>
+ <LazySection>
+ <DevicesLite />
+ </LazySection>
+ <LazySection>
+ <CountriesLite />
+ </LazySection>
+ <LazySection height="394px">
+ <Events />
+ </LazySection>
+ </div>
+ </div>
+ );
+ }
+
return (
<div className="p-2 md:p-4 max-w-[1100px] mx-auto space-y-3">
<SubHeader />
<MainSection />
<div className="grid grid-cols-1 lg:grid-cols-2 gap-3 mt-3">
- <LazySection><Referrers /></LazySection>
- <LazySection><Pages /></LazySection>
- <LazySection><Devices /></LazySection>
- <LazySection><Countries /></LazySection>
- <LazySection height="483px"><Events /></LazySection>
- <LazySection><Weekdays /></LazySection>
- {IS_CLOUD && <LazySection><SearchConsole /></LazySection>}
+ <LazySection>
+ <Referrers />
+ </LazySection>
+ <LazySection>
+ <Pages />
+ </LazySection>
+ <LazySection>
+ <Devices />
+ </LazySection>
+ <LazySection>
+ <Countries />
+ </LazySection>
+ <LazySection height="394px">
+ <Events />
+ </LazySection>
+ <LazySection>
+ <Weekdays />
+ </LazySection>
+ {IS_CLOUD && (
+ <LazySection>
+ <SearchConsole />
+ </LazySection>
+ )}
</div>
</div>
);
diff --git a/client/src/app/components/AddSite.tsx b/client/src/app/components/AddSite.tsx
index c6c122226..6996e6f75 100644
--- a/client/src/app/components/AddSite.tsx
+++ b/client/src/app/components/AddSite.tsx
@@ -1,6 +1,6 @@
"use client";
import { Button } from "@/components/ui/button";
-import { AlertCircle, AppWindow, Plus } from "lucide-react";
+import { AlertCircle, AppWindow, Globe2, Plus, Smartphone } from "lucide-react";
import { useExtracted } from "next-intl";
import { useRouter } from "next/navigation";
import { useState } from "react";
@@ -18,6 +18,7 @@ import {
} from "../../components/ui/dialog";
import { Input } from "../../components/ui/input";
import { Label } from "../../components/ui/label";
+import { RadioGroup, RadioGroupItem } from "../../components/ui/radio-group";
import { Switch } from "../../components/ui/switch";
import { Tooltip, TooltipContent, TooltipTrigger } from "../../components/ui/tooltip";
import { authClient } from "../../lib/auth";
@@ -26,6 +27,10 @@ import { resetStore, useStore } from "../../lib/store";
import { useStripeSubscription } from "../../lib/subscription/useStripeSubscription";
import { isValidDomain, normalizeDomain } from "../../lib/utils";
+type SiteType = "web" | "mobile";
+
+const isValidAppIdentifier = (value: string) => /^[A-Za-z0-9][A-Za-z0-9._-]{0,252}$/.test(value);
+
export function AddSite({ trigger, disabled }: { trigger?: React.ReactNode; disabled?: boolean }) {
const { setSite } = useStore();
const router = useRouter();
@@ -41,6 +46,7 @@ export function AddSite({ trigger, disabled }: { trigger?: React.ReactNode; disa
const finalDisabled = disabled || isOverSiteLimit;
const [open, setOpen] = useState(false);
+ const [siteType, setSiteType] = useState<SiteType>("web");
const [domain, setDomain] = useState("");
const [name, setName] = useState("");
const [isPublic, setIsPublic] = useState(false);
@@ -56,15 +62,20 @@ export function AddSite({ trigger, disabled }: { trigger?: React.ReactNode; disa
}
// Validate before attempting to add
- if (!isValidDomain(domain)) {
+ if (siteType === "web" && !isValidDomain(domain)) {
setError(t("Invalid domain format. Must be a valid domain like example.com or sub.example.com"));
return;
}
+ if (siteType === "mobile" && !isValidAppIdentifier(domain)) {
+ setError(t("Invalid app identifier. Use a bundle/package identifier like com.example.app"));
+ return;
+ }
try {
- const normalizedDomain = normalizeDomain(domain);
+ const normalizedDomain = siteType === "web" ? normalizeDomain(domain) : domain.trim();
const siteName = name.trim() || normalizedDomain;
const site = await addSite(normalizedDomain, siteName, activeOrganization.id, {
+ type: siteType,
isPublic,
saltUserIds,
});
@@ -82,6 +93,7 @@ export function AddSite({ trigger, disabled }: { trigger?: React.ReactNode; disa
};
const resetForm = () => {
+ setSiteType("web");
setDomain("");
setName("");
setError("");
@@ -89,7 +101,6 @@ export function AddSite({ trigger, disabled }: { trigger?: React.ReactNode; disa
setSaltUserIds(false);
};
-
if (subscription?.status !== "active" && subscription?.status !== "trialing" && IS_CLOUD) {
return (
<Tooltip>
@@ -97,13 +108,11 @@ export function AddSite({ trigger, disabled }: { trigger?: React.ReactNode; disa
{trigger || (
<Button disabled title={t("Upgrade to Pro to add more websites")}>
<Plus className="h-4 w-4" />
- {t("Add Website")}
+ {t("Add Site")}
</Button>
)}
</TooltipTrigger>
- <TooltipContent>
- {t("You need to be on an active subscription to add websites")}
- </TooltipContent>
+ <TooltipContent>{t("You need to be on an active subscription to add websites")}</TooltipContent>
</Tooltip>
);
}
@@ -116,12 +125,14 @@ export function AddSite({ trigger, disabled }: { trigger?: React.ReactNode; disa
{trigger || (
<Button disabled title={t("Upgrade to Pro to add more websites")}>
<Plus className="h-4 w-4" />
- {t("Add Website")}
+ {t("Add Site")}
</Button>
)}
</TooltipTrigger>
<TooltipContent>
- {t("You have reached the limit of {limit} websites. Upgrade to add more websites", { limit: String(siteLimit) })}
+ {t("You have reached the limit of {limit} websites. Upgrade to add more websites", {
+ limit: String(siteLimit),
+ })}
</TooltipContent>
</Tooltip>
);
@@ -142,7 +153,7 @@ export function AddSite({ trigger, disabled }: { trigger?: React.ReactNode; disa
{trigger || (
<Button disabled={finalDisabled}>
<Plus className="h-4 w-4" />
- {t("Add Website")}
+ {t("Add Site")}
</Button>
)}
</DialogTrigger>
@@ -150,21 +161,49 @@ export function AddSite({ trigger, disabled }: { trigger?: React.ReactNode; disa
<DialogHeader>
<DialogTitle className="flex items-center gap-2">
<AppWindow className="h-6 w-6" />
- {t("Add Website")}
+ {t("Add Site")}
</DialogTitle>
- <DialogDescription>{t("Track analytics for a new website in your organization")}</DialogDescription>
+ <DialogDescription>
+ {t("Track analytics for a new website or React Native app in your organization")}
+ </DialogDescription>
</DialogHeader>
<div className="grid gap-4 py-2">
+ <RadioGroup
+ value={siteType}
+ onValueChange={value => setSiteType(value as SiteType)}
+ className="grid grid-cols-2 gap-3"
+ >
+ <Label
+ htmlFor="site-type-web"
+ className="flex cursor-pointer items-center gap-2 rounded-md border border-neutral-200 p-3 text-sm dark:border-neutral-800"
+ >
+ <RadioGroupItem id="site-type-web" value="web" />
+ <Globe2 className="h-4 w-4" />
+ <span>{t("Website")}</span>
+ </Label>
+ <Label
+ htmlFor="site-type-mobile"
+ className="flex cursor-pointer items-center gap-2 rounded-md border border-neutral-200 p-3 text-sm dark:border-neutral-800"
+ >
+ <RadioGroupItem id="site-type-mobile" value="mobile" />
+ <Smartphone className="h-4 w-4" />
+ <span>{t("React Native App")}</span>
+ </Label>
+ </RadioGroup>
+
<div className="grid w-full items-center gap-1.5">
<Label htmlFor="domain" className="text-sm font-medium">
- {t("Domain")}
+ {siteType === "web" ? t("Domain") : t("App Identifier")}
</Label>
<Input
id="domain"
value={domain}
- onChange={e => setDomain(e.target.value.toLowerCase())}
- placeholder="example.com or sub.example.com"
+ onChange={e => {
+ const value = e.target.value.trim();
+ setDomain(siteType === "web" ? value.toLowerCase() : value);
+ }}
+ placeholder={siteType === "web" ? "example.com or sub.example.com" : "com.example.app"}
/>
</div>
<div className="grid w-full items-center gap-1.5">
@@ -208,7 +247,7 @@ export function AddSite({ trigger, disabled }: { trigger?: React.ReactNode; disa
{error && (
<Alert variant="destructive">
<AlertCircle className="h-4 w-4" />
- <AlertTitle>{t("Error Adding Website")}</AlertTitle>
+ <AlertTitle>{t("Error Adding Site")}</AlertTitle>
<AlertDescription>{error}</AlertDescription>
</Alert>
)}
diff --git a/client/src/app/rollup/components/MainSection/MainSection.tsx b/client/src/app/rollup/components/MainSection/MainSection.tsx
index 069595f64..4083af34a 100644
--- a/client/src/app/rollup/components/MainSection/MainSection.tsx
+++ b/client/src/app/rollup/components/MainSection/MainSection.tsx
@@ -66,10 +66,12 @@ export function MainSection({
siteIds,
sites,
siteColorMap,
+ lite = false,
}: {
siteIds: number[];
sites: SiteRow[];
siteColorMap: Map<number, string>;
+ lite?: boolean;
}) {
const t = useExtracted();
const { selectedStat, bucket, time } = useStore();
@@ -77,6 +79,7 @@ export function MainSection({
const { series, isFetching, isLoading } = useRollupBucketed({
siteIds,
bucket,
+ lite,
});
const siteMetaById = useMemo(() => {
diff --git a/client/src/app/rollup/components/sections/CountriesLite.tsx b/client/src/app/rollup/components/sections/CountriesLite.tsx
new file mode 100644
index 000000000..1dd0e22bb
--- /dev/null
+++ b/client/src/app/rollup/components/sections/CountriesLite.tsx
@@ -0,0 +1,50 @@
+"use client";
+import { Expand } from "lucide-react";
+import { useExtracted } from "next-intl";
+import { useState } from "react";
+import { CountryFlag } from "@/app/[site]/components/shared/icons/CountryFlag";
+import { Button } from "@/components/ui/button";
+import { Card, CardContent } from "@/components/ui/card";
+import { getCountryName } from "@/lib/utils";
+import { RollupSection } from "./RollupSection";
+
+// Lite Countries section for the rollup: country only (the lite metric MV is
+// keyed on country and doesn't expose region/city/language/timezone).
+export function CountriesLite({ siteIds }: { siteIds: number[] }) {
+ const [expanded, setExpanded] = useState(false);
+ const t = useExtracted();
+
+ return (
+ <Card className="h-[405px]">
+ <CardContent className="mt-2">
+ <div className="flex flex-row gap-2 justify-between items-center mb-2">
+ <div className="text-sm font-medium text-neutral-700 dark:text-neutral-200 px-1">
+ {t("Countries")}
+ </div>
+ <div className="w-7">
+ <Button size="smIcon" onClick={() => setExpanded(!expanded)}>
+ <Expand className="w-4 h-4" />
+ </Button>
+ </div>
+ </div>
+ <RollupSection
+ siteIds={siteIds}
+ filterParameter="country"
+ title={t("Countries")}
+ getKey={(e) => e.value}
+ getValue={(e) => e.value}
+ getFilterLabel={(e) => getCountryName(e.value) || ""}
+ getLabel={(e) => (
+ <div className="flex gap-2 items-center">
+ <CountryFlag country={e.value} />
+ {getCountryName(e.value) || t("Unknown")}
+ </div>
+ )}
+ expanded={expanded}
+ close={() => setExpanded(false)}
+ lite
+ />
+ </CardContent>
+ </Card>
+ );
+}
diff --git a/client/src/app/rollup/components/sections/PagesLite.tsx b/client/src/app/rollup/components/sections/PagesLite.tsx
new file mode 100644
index 000000000..3c3f0c70b
--- /dev/null
+++ b/client/src/app/rollup/components/sections/PagesLite.tsx
@@ -0,0 +1,45 @@
+"use client";
+import { Expand } from "lucide-react";
+import { useExtracted } from "next-intl";
+import { useState } from "react";
+import { Button } from "@/components/ui/button";
+import { Card, CardContent } from "@/components/ui/card";
+import { truncateString } from "@/lib/utils";
+import { RollupSection } from "./RollupSection";
+
+// Lite Pages section for the rollup: pathname only (the lite metric MV is
+// keyed on pathname and doesn't expose titles/entries/exits/hostnames).
+// Pathname collisions across sites get merged together — there's no per-site
+// hostname column on the lite endpoint, so e.g. "/" buckets every site's home.
+export function PagesLite({ siteIds }: { siteIds: number[] }) {
+ const [expanded, setExpanded] = useState(false);
+ const t = useExtracted();
+
+ return (
+ <Card className="h-[405px]">
+ <CardContent className="mt-2">
+ <div className="flex flex-row gap-2 justify-between items-center mb-2">
+ <div className="text-sm font-medium text-neutral-700 dark:text-neutral-200 px-1">
+ {t("Pages")}
+ </div>
+ <div className="w-7">
+ <Button size="smIcon" onClick={() => setExpanded(!expanded)}>
+ <Expand className="w-4 h-4" />
+ </Button>
+ </div>
+ </div>
+ <RollupSection
+ siteIds={siteIds}
+ filterParameter="pathname"
+ title={t("Pages")}
+ getKey={(e) => e.value}
+ getValue={(e) => e.value}
+ getLabel={(e) => truncateString(e.value, 50) || t("Other")}
+ expanded={expanded}
+ close={() => setExpanded(false)}
+ lite
+ />
+ </CardContent>
+ </Card>
+ );
+}
diff --git a/client/src/app/rollup/components/sections/RollupSection.tsx b/client/src/app/rollup/components/sections/RollupSection.tsx
index 612c049db..3dbb701a3 100644
--- a/client/src/app/rollup/components/sections/RollupSection.tsx
+++ b/client/src/app/rollup/components/sections/RollupSection.tsx
@@ -25,6 +25,7 @@ export function RollupSection({
countLabel,
expanded,
close,
+ lite = false,
}: {
title: string;
filterParameter: FilterParameter;
@@ -37,12 +38,14 @@ export function RollupSection({
countLabel?: string;
expanded: boolean;
close: () => void;
+ lite?: boolean;
}) {
const t = useExtracted();
const { data, isLoading, isFetching, error } = useRollupMetric({
siteIds,
parameter: filterParameter,
limit: 100,
+ lite,
});
const items = data;
@@ -128,6 +131,7 @@ export function RollupSection({
getLink={getLink}
expanded={expanded}
close={close}
+ lite={lite}
/>
)}
</>
diff --git a/client/src/app/rollup/components/sections/RollupSectionDialog.tsx b/client/src/app/rollup/components/sections/RollupSectionDialog.tsx
index 1261f37f6..391a7af73 100644
--- a/client/src/app/rollup/components/sections/RollupSectionDialog.tsx
+++ b/client/src/app/rollup/components/sections/RollupSectionDialog.tsx
@@ -37,6 +37,7 @@ export function RollupSectionDialog({
getLink,
expanded,
close,
+ lite = false,
}: {
title: string;
filterParameter: FilterParameter;
@@ -47,12 +48,14 @@ export function RollupSectionDialog({
getLink?: (item: MetricResponse) => string;
expanded: boolean;
close: () => void;
+ lite?: boolean;
}) {
const t = useExtracted();
const { data, isLoading } = useRollupMetric({
siteIds,
parameter: filterParameter,
limit: 1000,
+ lite,
});
const [searchTerm, setSearchTerm] = useState("");
diff --git a/client/src/app/rollup/hooks/useRollupBucketed.ts b/client/src/app/rollup/hooks/useRollupBucketed.ts
index e2709aa10..59fafa3bf 100644
--- a/client/src/app/rollup/hooks/useRollupBucketed.ts
+++ b/client/src/app/rollup/hooks/useRollupBucketed.ts
@@ -2,6 +2,7 @@ import { TimeBucket } from "@rybbit/shared";
import { useQueries } from "@tanstack/react-query";
import {
fetchOverviewBucketed,
+ fetchOverviewBucketedLite,
GetOverviewBucketedResponse,
} from "@/api/analytics/endpoints";
import { buildApiParams } from "@/api/utils";
@@ -22,24 +23,32 @@ export type UseRollupBucketedResult = {
export function useRollupBucketed({
siteIds,
bucket,
+ lite = false,
}: {
siteIds: number[];
bucket: TimeBucket;
+ lite?: boolean;
}): UseRollupBucketedResult {
const { time, filters, timezone } = useStore();
- const params = buildApiParams(time, { filters });
+ // Lite endpoints don't accept filters; drop them so the request and the
+ // query key stay clean.
+ const effectiveFilters = lite ? undefined : filters;
+ const params = buildApiParams(time, { filters: effectiveFilters });
const queries = useQueries({
queries: siteIds.map((siteId) => ({
queryKey: [
- "rollup-overview-bucketed",
+ lite ? "rollup-overview-bucketed-lite" : "rollup-overview-bucketed",
siteId,
time,
bucket,
- filters,
+ effectiveFilters,
timezone,
],
- queryFn: () => fetchOverviewBucketed(siteId, { ...params, bucket }),
+ queryFn: () => {
+ const fetcher = lite ? fetchOverviewBucketedLite : fetchOverviewBucketed;
+ return fetcher(siteId, { ...params, bucket });
+ },
staleTime: 60_000,
})),
});
diff --git a/client/src/app/rollup/hooks/useRollupMetric.ts b/client/src/app/rollup/hooks/useRollupMetric.ts
index 3a75caf1d..35568947f 100644
--- a/client/src/app/rollup/hooks/useRollupMetric.ts
+++ b/client/src/app/rollup/hooks/useRollupMetric.ts
@@ -1,7 +1,11 @@
import { FilterParameter } from "@rybbit/shared";
import { useQueries } from "@tanstack/react-query";
import { useMemo } from "react";
-import { fetchMetric, MetricResponse } from "@/api/analytics/endpoints";
+import {
+ fetchMetric,
+ fetchMetricLite,
+ MetricResponse,
+} from "@/api/analytics/endpoints";
import { buildApiParams } from "@/api/utils";
import { useStore } from "@/lib/store";
@@ -18,27 +22,32 @@ export function useRollupMetric({
siteIds,
parameter,
limit = 100,
+ lite = false,
}: {
siteIds: number[];
parameter: FilterParameter;
limit?: number;
+ lite?: boolean;
}): UseRollupMetricResult {
const { time, filters, timezone } = useStore();
- const params = buildApiParams(time, { filters });
+ const effectiveFilters = lite ? undefined : filters;
+ const params = buildApiParams(time, { filters: effectiveFilters });
const queries = useQueries({
queries: siteIds.map((siteId) => ({
queryKey: [
- "rollup-metric",
+ lite ? "rollup-metric-lite" : "rollup-metric",
parameter,
siteId,
time,
- filters,
+ effectiveFilters,
limit,
timezone,
],
- queryFn: () =>
- fetchMetric(siteId, { ...params, parameter, limit, page: 1 }),
+ queryFn: () => {
+ const fetcher = lite ? fetchMetricLite : fetchMetric;
+ return fetcher(siteId, { ...params, parameter, limit, page: 1 });
+ },
staleTime: 60_000,
})),
});
diff --git a/client/src/app/rollup/page.tsx b/client/src/app/rollup/page.tsx
index 5019a7968..acfc3866c 100644
--- a/client/src/app/rollup/page.tsx
+++ b/client/src/app/rollup/page.tsx
@@ -12,12 +12,15 @@ import { Card } from "@/components/ui/card";
import { useInView } from "@/hooks/useInView";
import { useSetPageTitle } from "@/hooks/useSetPageTitle";
import { authClient } from "@/lib/auth";
+import { LITE_DASHBOARD } from "@/lib/const";
import { buildSiteColorMap } from "./components/MainSection/Chart";
import { MainSection } from "./components/MainSection/MainSection";
import { RollupTopBar } from "./components/RollupTopBar";
import { SiteToggleStrip } from "./components/SiteToggleStrip";
import { Countries } from "./components/sections/Countries";
+import { CountriesLite } from "./components/sections/CountriesLite";
import { Devices } from "./components/sections/Devices";
+import { PagesLite } from "./components/sections/PagesLite";
import { Referrers } from "./components/sections/Referrers";
function LazySection({
@@ -105,6 +108,23 @@ export default function RollupPage() {
<Card className="p-6 text-center text-sm text-neutral-500 dark:text-neutral-400">
{t("Select at least one site to view rollup analytics.")}
</Card>
+ ) : LITE_DASHBOARD ? (
+ <>
+ <MainSection
+ siteIds={effectiveSiteIds}
+ sites={filteredSites}
+ siteColorMap={siteColorMap}
+ lite
+ />
+ <div className="grid grid-cols-1 lg:grid-cols-2 gap-3 mt-3">
+ <LazySection>
+ <PagesLite siteIds={effectiveSiteIds} />
+ </LazySection>
+ <LazySection>
+ <CountriesLite siteIds={effectiveSiteIds} />
+ </LazySection>
+ </div>
+ </>
) : (
<>
<MainSection
diff --git a/client/src/app/settings/organization/components/CreateUserDialog.tsx b/client/src/app/settings/organization/components/CreateUserDialog.tsx
index 478b81658..d4b569964 100644
--- a/client/src/app/settings/organization/components/CreateUserDialog.tsx
+++ b/client/src/app/settings/organization/components/CreateUserDialog.tsx
@@ -18,9 +18,8 @@ import { useExtracted } from "next-intl";
import { useState } from "react";
import { toast } from "@/components/ui/sonner";
import { Alert } from "../../../../components/ui/alert";
-import { authClient } from "../../../../lib/auth";
import { validateEmail } from "../../../../lib/auth-utils";
-import { useAddUserToOrganization } from "../../../../api/admin/hooks/useOrganizations";
+import { useCreateUserInOrganization } from "../../../../api/admin/hooks/useOrganizations";
interface CreateUserDialogProps {
organizationId: string;
@@ -37,7 +36,7 @@ export function CreateUserDialog({ organizationId, onSuccess }: CreateUserDialog
const [open, setOpen] = useState(false);
const [error, setError] = useState("");
- const addUserToOrganization = useAddUserToOrganization();
+ const createUserInOrganization = useCreateUserInOrganization();
const resetState = (open = false) => {
setOpen(open);
@@ -65,14 +64,10 @@ export function CreateUserDialog({ organizationId, onSuccess }: CreateUserDialog
}
try {
- await authClient.admin.createUser({
+ await createUserInOrganization.mutateAsync({
email,
name: name || email,
password,
- });
-
- await addUserToOrganization.mutateAsync({
- email,
role,
organizationId,
});
@@ -148,8 +143,8 @@ export function CreateUserDialog({ organizationId, onSuccess }: CreateUserDialog
<Button variant="outline" onClick={() => resetState(false)}>
{t("Cancel")}
</Button>
- <Button onClick={handleInvite} disabled={addUserToOrganization.isPending} variant="success">
- {addUserToOrganization.isPending ? t("Creating...") : t("Create User")}
+ <Button onClick={handleInvite} disabled={createUserInOrganization.isPending} variant="success">
+ {createUserInOrganization.isPending ? t("Creating...") : t("Create User")}
</Button>
</DialogFooter>
</DialogContent>
diff --git a/client/src/components/AppSidebar.tsx b/client/src/components/AppSidebar.tsx
index a1af690bd..1b3d5a700 100644
--- a/client/src/components/AppSidebar.tsx
+++ b/client/src/components/AppSidebar.tsx
@@ -9,7 +9,7 @@ import { useEmbedablePage } from "../app/[site]/utils";
import { useAdminPermission } from "../app/admin/hooks/useAdminPermission";
import { useSignout } from "../hooks/useSignout";
import { authClient } from "../lib/auth";
-import { IS_CLOUD } from "../lib/const";
+import { DEPLOYMENT, IS_CLOUD } from "../lib/const";
import { useStripeSubscription } from "../lib/subscription/useStripeSubscription";
import { cn } from "../lib/utils";
import { RybbitLogo } from "./RybbitLogo";
@@ -19,7 +19,7 @@ function AdminLink({ isExpanded }: { isExpanded: boolean }) {
const pathname = usePathname();
const { isAdmin } = useAdminPermission();
const t = useExtracted();
- if (!IS_CLOUD || !isAdmin) return null;
+ if ((!IS_CLOUD && !DEPLOYMENT) || !isAdmin) return null;
return (
<SidebarLink
diff --git a/client/src/components/BucketSelection.tsx b/client/src/components/BucketSelection.tsx
index de1899b4f..a7d697d8b 100644
--- a/client/src/components/BucketSelection.tsx
+++ b/client/src/components/BucketSelection.tsx
@@ -1,6 +1,7 @@
"use client";
import { getTimezone, useStore } from "@/lib/store";
+import { LITE_DASHBOARD } from "@/lib/const";
import { SelectItem, Select, SelectContent, SelectTrigger, SelectValue } from "@/components/ui/select";
import { TimeBucket } from "@rybbit/shared";
import { DateTime } from "luxon";
@@ -74,7 +75,11 @@ export function BucketSelection({ size = "sm" }: { size?: "default" | "sm" }) {
const renderOptions = (options: TimeBucket[], durationMinutes: number | null) => {
const availableOptions = options.filter(
- option => durationMinutes === null || durationMinutes >= bucketDurationMinutes(option) * 2
+ option =>
+ // The lite dashboard is backed by hourly materialized views, so buckets
+ // finer than an hour have no underlying data.
+ (!LITE_DASHBOARD || bucketDurationMinutes(option) >= 60) &&
+ (durationMinutes === null || durationMinutes >= bucketDurationMinutes(option) * 2)
);
return (
diff --git a/client/src/components/SiteCard.tsx b/client/src/components/SiteCard.tsx
index 12c0ae58c..f7aade88d 100644
--- a/client/src/components/SiteCard.tsx
+++ b/client/src/components/SiteCard.tsx
@@ -6,6 +6,7 @@ import { useGetOverview } from "../api/analytics/hooks/useGetOverview";
import { useGetOverviewBucketed } from "../api/analytics/hooks/useGetOverviewBucketed";
import { ChangePercentage } from "../app/[site]/main/components/MainSection/Overview";
import { useInView } from "../hooks/useInView";
+import { LITE_DASHBOARD } from "../lib/const";
import { useStore } from "../lib/store";
import { formatter } from "../lib/utils";
import { Favicon } from "./Favicon";
@@ -45,6 +46,7 @@ export function SiteCard({ siteId, name, domain, tags = [], allTags = [], onTags
site: siteId,
bucket,
useFilters: false,
+ lite: LITE_DASHBOARD,
props: {
enabled: isInView,
},
@@ -57,6 +59,7 @@ export function SiteCard({ siteId, name, domain, tags = [], allTags = [], onTags
} = useGetOverview({
site: siteId,
useFilters: false,
+ lite: LITE_DASHBOARD,
});
// Previous period - automatically handles both regular time-based and past-minutes queries
@@ -64,6 +67,7 @@ export function SiteCard({ siteId, name, domain, tags = [], allTags = [], onTags
site: siteId,
periodTime: "previous",
useFilters: false,
+ lite: LITE_DASHBOARD,
});
// Update the hasLoadedData ref when data loads successfully
diff --git a/client/src/components/SiteSettings/GeneralTab.tsx b/client/src/components/SiteSettings/GeneralTab.tsx
index 8c1bb6156..c5b0cdbcb 100644
--- a/client/src/components/SiteSettings/GeneralTab.tsx
+++ b/client/src/components/SiteSettings/GeneralTab.tsx
@@ -49,6 +49,8 @@ export function GeneralTab({ siteMetadata, disabled = false, onClose, onPublicCh
const t = useExtracted();
const { refetch } = useGetSitesFromOrg(siteMetadata?.organizationId ?? "");
const router = useRouter();
+ const isMobileSite = siteMetadata.type === "mobile";
+ const identifierLabel = isMobileSite ? t("App Identifier") : t("Domain");
const [newName, setNewName] = useState(siteMetadata.name);
const [isChangingName, setIsChangingName] = useState(false);
@@ -118,15 +120,15 @@ export function GeneralTab({ siteMetadata, disabled = false, onClose, onPublicCh
const handleDomainChange = async () => {
if (!newDomain) {
- toast.error(t("Domain cannot be empty"));
+ toast.error(isMobileSite ? t("App identifier cannot be empty") : t("Domain cannot be empty"));
return;
}
try {
setIsChangingDomain(true);
- const normalizedDomain = normalizeDomain(newDomain);
+ const normalizedDomain = isMobileSite ? newDomain.trim() : normalizeDomain(newDomain);
await updateSiteConfig(siteMetadata.siteId, { domain: normalizedDomain });
- toast.success(t("Domain updated successfully"));
+ toast.success(isMobileSite ? t("App identifier updated successfully") : t("Domain updated successfully"));
router.refresh();
refetch();
} catch (error) {
@@ -213,14 +215,19 @@ export function GeneralTab({ siteMetadata, disabled = false, onClose, onPublicCh
<div className="space-y-3">
<div>
- <h4 className="text-sm font-semibold text-foreground">{t("Domain")}</h4>
- <p className="text-xs text-muted-foreground">{t("The domain used for tracking")}</p>
+ <h4 className="text-sm font-semibold text-foreground">{identifierLabel}</h4>
+ <p className="text-xs text-muted-foreground">
+ {isMobileSite ? t("The bundle or package identifier used for tracking") : t("The domain used for tracking")}
+ </p>
</div>
<div className="flex space-x-2">
<Input
value={newDomain}
- onChange={e => setNewDomain(e.target.value.toLowerCase())}
- placeholder="example.com"
+ onChange={e => {
+ const value = e.target.value.trim();
+ setNewDomain(isMobileSite ? value : value.toLowerCase());
+ }}
+ placeholder={isMobileSite ? "com.example.app" : "example.com"}
/>
<Button
variant="outline"
diff --git a/client/src/components/SiteSettings/ScriptBuilder.tsx b/client/src/components/SiteSettings/ScriptBuilder.tsx
index 4e094c313..e4f7f2339 100644
--- a/client/src/components/SiteSettings/ScriptBuilder.tsx
+++ b/client/src/components/SiteSettings/ScriptBuilder.tsx
@@ -10,9 +10,11 @@ import { useState } from "react";
interface ScriptBuilderProps {
siteId: string;
+ siteType?: "web" | "mobile" | null;
+ appIdentifier?: string;
}
-export function ScriptBuilder({ siteId }: ScriptBuilderProps) {
+export function ScriptBuilder({ siteId, siteType = "web", appIdentifier }: ScriptBuilderProps) {
const t = useExtracted();
const [debounceValue, setDebounceValue] = useState(500);
const [skipPatterns, setSkipPatterns] = useState<string[]>([]);
@@ -76,22 +78,56 @@ export function ScriptBuilder({ siteId }: ScriptBuilderProps) {
// Generate tracking script dynamically based on options
const trackingScript = `<script
src="${globalThis.location.origin}/api/script.js"
- data-site-id="${siteId}"${debounceValue !== 500
- ? `
+ data-site-id="${siteId}"${
+ debounceValue !== 500
+ ? `
data-debounce="${debounceValue}"`
- : ""
- }${skipPatterns.length > 0
- ? `
+ : ""
+ }${
+ skipPatterns.length > 0
+ ? `
data-skip-patterns='${JSON.stringify(skipPatterns)}'`
- : ""
- }${maskPatterns.length > 0
- ? `
+ : ""
+ }${
+ maskPatterns.length > 0
+ ? `
data-mask-patterns='${JSON.stringify(maskPatterns)}'`
- : ""
+ : ""
}
defer
></script>`;
+ const reactNativeInstall = "npm install @rybbit/react-native @react-native-async-storage/async-storage";
+ const reactNativeSnippet = `import AsyncStorage from "@react-native-async-storage/async-storage";
+import rybbit from "@rybbit/react-native";
+
+await rybbit.init({
+ analyticsHost: "${globalThis.location.origin}/api",
+ siteId: "${siteId}",
+ appIdentifier: "${appIdentifier || "com.example.app"}",
+ storage: AsyncStorage,
+ initialScreenName: "Home",
+});
+
+await rybbit.event("signup_started", { plan: "pro" });`;
+
+ if (siteType === "mobile") {
+ return (
+ <div className="space-y-6">
+ <div className="space-y-3">
+ <div>
+ <h4 className="text-sm font-semibold text-foreground">{t("React Native SDK")}</h4>
+ <p className="text-xs text-muted-foreground">
+ {t("Install the React Native package and initialize it in your app entry point")}
+ </p>
+ </div>
+ <CodeSnippet language="bash" code={reactNativeInstall} />
+ <CodeSnippet language="TypeScript" code={reactNativeSnippet} />
+ </div>
+ </div>
+ );
+ }
+
return (
<div className="space-y-6">
<div className="space-y-3">
@@ -113,7 +149,9 @@ export function ScriptBuilder({ siteId }: ScriptBuilderProps) {
<Label htmlFor="skipPatterns" className="text-sm font-medium text-foreground block">
{t("Skip Patterns")}
</Label>
- <p className="text-xs text-muted-foreground mt-1">{t("URL patterns to exclude from tracking (one per line)")}</p>
+ <p className="text-xs text-muted-foreground mt-1">
+ {t("URL patterns to exclude from tracking (one per line)")}
+ </p>
<p className="text-xs text-muted-foreground mt-1">
{t("Use * for single segment wildcard, ** for multi-segment wildcard")}
</p>
@@ -168,7 +206,9 @@ export function ScriptBuilder({ siteId }: ScriptBuilderProps) {
<span className="text-xs text-muted-foreground">{t("Default: 500ms")}</span>
</div>
</div>
- <p className="text-xs text-muted-foreground">{t("Time to wait before tracking a pageview after URL changes")}</p>
+ <p className="text-xs text-muted-foreground">
+ {t("Time to wait before tracking a pageview after URL changes")}
+ </p>
</div>
</div>
</div>
diff --git a/client/src/components/SiteSettings/SiteSettings.tsx b/client/src/components/SiteSettings/SiteSettings.tsx
index b1fd46294..ca28a76a5 100644
--- a/client/src/components/SiteSettings/SiteSettings.tsx
+++ b/client/src/components/SiteSettings/SiteSettings.tsx
@@ -95,13 +95,14 @@ function SiteSettingsInner({ siteMetadata, trigger }: { siteMetadata: SiteRespon
}
const currentSiteMetadata = { ...siteMetadata, public: sitePublic };
+ const isMobileSite = currentSiteMetadata.type === "mobile";
const tabs: { key: TabKey; label: string; icon: React.ComponentType<{ className?: string }>; hidden?: boolean }[] = [
{ key: "general", label: t("General"), icon: Settings },
{ key: "tracking", label: t("Tracking"), icon: SlidersHorizontal },
{ key: "exclusions", label: t("Exclusions"), icon: Ban },
{ key: "integrations", label: t("Integrations"), icon: Plug, hidden: !IS_CLOUD },
- { key: "script", label: t("Tracking Script"), icon: Code },
+ { key: "script", label: isMobileSite ? t("React Native SDK") : t("Tracking Script"), icon: Code },
{ key: "widget-embeds", label: t("Widget Embeds"), icon: LayoutTemplate },
{ key: "dashboard-embed", label: t("Dashboard Embed"), icon: LayoutDashboard },
{ key: "import", label: t("Import"), icon: Download },
@@ -177,7 +178,13 @@ function SiteSettingsInner({ siteMetadata, trigger }: { siteMetadata: SiteRespon
{activeTab === "tracking" && <TrackingTab siteMetadata={currentSiteMetadata} disabled={disabled} />}
{activeTab === "exclusions" && <ExclusionsTab siteId={siteMetadata.siteId} disabled={disabled} />}
{activeTab === "integrations" && IS_CLOUD && <IntegrationsTab disabled={disabled} />}
- {activeTab === "script" && <ScriptBuilder siteId={siteMetadata.id ?? String(siteMetadata.siteId)} />}
+ {activeTab === "script" && (
+ <ScriptBuilder
+ siteId={siteMetadata.id ?? String(siteMetadata.siteId)}
+ siteType={currentSiteMetadata.type || "web"}
+ appIdentifier={currentSiteMetadata.domain}
+ />
+ )}
{activeTab === "widget-embeds" && (
<EmbedTab siteMetadata={currentSiteMetadata} embedEnabled={embedEnabled} />
)}
diff --git a/client/src/components/SiteSettings/TrackingTab.tsx b/client/src/components/SiteSettings/TrackingTab.tsx
index 017f6fd15..e14a9fff7 100644
--- a/client/src/components/SiteSettings/TrackingTab.tsx
+++ b/client/src/components/SiteSettings/TrackingTab.tsx
@@ -33,6 +33,7 @@ interface ToggleConfig {
export function TrackingTab({ siteMetadata, disabled = false }: TrackingTabProps) {
const t = useExtracted();
const { refetch } = useGetSitesFromOrg(siteMetadata?.organizationId ?? "");
+ const isMobileSite = siteMetadata.type === "mobile";
const [toggleStates, setToggleStates] = useState({
sessionReplay: siteMetadata.sessionReplay || false,
@@ -92,58 +93,64 @@ export function TrackingTab({ siteMetadata, disabled = false }: TrackingTabProps
IS_CLOUD;
const analyticsToggles: ToggleConfig[] = [
- ...(!subscription?.planName?.startsWith("appsumo") && !isSubscriptionLoading
+ ...(!isMobileSite && !subscription?.planName?.startsWith("appsumo") && !isSubscriptionLoading
? [
- {
- id: "sessionReplay",
- label: t("Session Replay"),
- description: t("Record and replay user sessions to understand user behavior"),
- value: toggleStates.sessionReplay,
- key: "sessionReplay",
- enabledMessage: t("Session replay enabled"),
- disabledMessage: t("Session replay disabled"),
- disabled: sessionReplayDisabled,
- badge: <Badge variant="success">Pro</Badge>,
- } as ToggleConfig,
- ]
+ {
+ id: "sessionReplay",
+ label: t("Session Replay"),
+ description: t("Record and replay user sessions to understand user behavior"),
+ value: toggleStates.sessionReplay,
+ key: "sessionReplay",
+ enabledMessage: t("Session replay enabled"),
+ disabledMessage: t("Session replay disabled"),
+ disabled: sessionReplayDisabled,
+ badge: <Badge variant="success">Pro</Badge>,
+ } as ToggleConfig,
+ ]
: []),
- ...(IS_CLOUD
+ ...(IS_CLOUD && !isMobileSite
? [
- {
- id: "webVitals",
- label: t("Web Vitals"),
- description: t("Track Core Web Vitals metrics (LCP, CLS, INP, FCP, TTFB)"),
- value: toggleStates.webVitals,
- key: "webVitals" as keyof SiteResponse,
- enabledMessage: t("Web Vitals enabled"),
- disabledMessage: t("Web Vitals disabled"),
- disabled: standardFeaturesDisabled,
- badge: <Badge variant="success">Standard</Badge>,
- } as ToggleConfig,
- ]
+ {
+ id: "webVitals",
+ label: t("Web Vitals"),
+ description: t("Track Core Web Vitals metrics (LCP, CLS, INP, FCP, TTFB)"),
+ value: toggleStates.webVitals,
+ key: "webVitals" as keyof SiteResponse,
+ enabledMessage: t("Web Vitals enabled"),
+ disabledMessage: t("Web Vitals disabled"),
+ disabled: standardFeaturesDisabled,
+ badge: <Badge variant="success">Standard</Badge>,
+ } as ToggleConfig,
+ ]
+ : []),
+ ...(!isMobileSite
+ ? [
+ {
+ id: "trackSpaNavigation",
+ label: t("SPA Navigation"),
+ description: t("Automatically track navigation in single-page applications"),
+ value: toggleStates.trackSpaNavigation,
+ key: "trackSpaNavigation",
+ enabledMessage: t("SPA navigation tracking enabled"),
+ disabledMessage: t("SPA navigation tracking disabled"),
+ } as ToggleConfig,
+ {
+ id: "trackUrlParams",
+ label: t("URL Parameters"),
+ description: t("Include query string parameters in page tracking"),
+ value: toggleStates.trackUrlParams,
+ key: "trackUrlParams",
+ enabledMessage: t("URL parameters tracking enabled"),
+ disabledMessage: t("URL parameters tracking disabled"),
+ } as ToggleConfig,
+ ]
: []),
- {
- id: "trackSpaNavigation",
- label: t("SPA Navigation"),
- description: t("Automatically track navigation in single-page applications"),
- value: toggleStates.trackSpaNavigation,
- key: "trackSpaNavigation",
- enabledMessage: t("SPA navigation tracking enabled"),
- disabledMessage: t("SPA navigation tracking disabled"),
- },
- {
- id: "trackUrlParams",
- label: t("URL Parameters"),
- description: t("Include query string parameters in page tracking"),
- value: toggleStates.trackUrlParams,
- key: "trackUrlParams",
- enabledMessage: t("URL parameters tracking enabled"),
- disabledMessage: t("URL parameters tracking disabled"),
- },
{
id: "trackInitialPageView",
- label: t("Initial Page View"),
- description: t("Automatically track the first page view when the script loads"),
+ label: isMobileSite ? t("Initial Screen View") : t("Initial Page View"),
+ description: isMobileSite
+ ? t("Automatically track the initial screen passed to the React Native SDK")
+ : t("Automatically track the first page view when the script loads"),
value: toggleStates.trackInitialPageView,
key: "trackInitialPageView",
enabledMessage: t("Initial page view tracking enabled"),
@@ -152,19 +159,25 @@ export function TrackingTab({ siteMetadata, disabled = false }: TrackingTabProps
];
const autoCaptureToggles: ToggleConfig[] = [
- {
- id: "trackOutbound",
- label: t("Outbound Links"),
- description: t("Track when users click on external links"),
- value: toggleStates.trackOutbound,
- key: "trackOutbound",
- enabledMessage: t("Outbound tracking enabled"),
- disabledMessage: t("Outbound tracking disabled"),
- },
+ ...(!isMobileSite
+ ? [
+ {
+ id: "trackOutbound",
+ label: t("Outbound Links"),
+ description: t("Track when users click on external links"),
+ value: toggleStates.trackOutbound,
+ key: "trackOutbound",
+ enabledMessage: t("Outbound tracking enabled"),
+ disabledMessage: t("Outbound tracking disabled"),
+ } as ToggleConfig,
+ ]
+ : []),
{
id: "trackErrors",
label: t("Error Tracking"),
- description: t("Capture JavaScript errors and exceptions from your site"),
+ description: isMobileSite
+ ? t("Allow error events sent by the React Native SDK")
+ : t("Capture JavaScript errors and exceptions from your site"),
value: toggleStates.trackErrors,
key: "trackErrors",
enabledMessage: t("Error tracking enabled"),
@@ -172,39 +185,43 @@ export function TrackingTab({ siteMetadata, disabled = false }: TrackingTabProps
disabled: standardFeaturesDisabled,
badge: <Badge variant="success">Standard</Badge>,
},
- {
- id: "trackButtonClicks",
- label: t("Button Clicks"),
- description: t("Automatically track clicks on all buttons"),
- value: toggleStates.trackButtonClicks,
- key: "trackButtonClicks",
- enabledMessage: t("Button click tracking enabled"),
- disabledMessage: t("Button click tracking disabled"),
- disabled: standardFeaturesDisabled,
- badge: <Badge variant="success">Standard</Badge>,
- },
- {
- id: "trackCopy",
- label: t("Copy Events"),
- description: t("Track when users copy text from your site"),
- value: toggleStates.trackCopy,
- key: "trackCopy",
- enabledMessage: t("Copy tracking enabled"),
- disabledMessage: t("Copy tracking disabled"),
- disabled: standardFeaturesDisabled,
- badge: <Badge variant="success">Standard</Badge>,
- },
- {
- id: "trackFormInteractions",
- label: t("Form Interactions"),
- description: t("Automatically track form submissions and input/select changes"),
- value: toggleStates.trackFormInteractions,
- key: "trackFormInteractions",
- enabledMessage: t("Form interaction tracking enabled"),
- disabledMessage: t("Form interaction tracking disabled"),
- disabled: standardFeaturesDisabled,
- badge: <Badge variant="success">Standard</Badge>,
- },
+ ...(!isMobileSite
+ ? [
+ {
+ id: "trackButtonClicks",
+ label: t("Button Clicks"),
+ description: t("Automatically track clicks on all buttons"),
+ value: toggleStates.trackButtonClicks,
+ key: "trackButtonClicks",
+ enabledMessage: t("Button click tracking enabled"),
+ disabledMessage: t("Button click tracking disabled"),
+ disabled: standardFeaturesDisabled,
+ badge: <Badge variant="success">Standard</Badge>,
+ } as ToggleConfig,
+ {
+ id: "trackCopy",
+ label: t("Copy Events"),
+ description: t("Track when users copy text from your site"),
+ value: toggleStates.trackCopy,
+ key: "trackCopy",
+ enabledMessage: t("Copy tracking enabled"),
+ disabledMessage: t("Copy tracking disabled"),
+ disabled: standardFeaturesDisabled,
+ badge: <Badge variant="success">Standard</Badge>,
+ } as ToggleConfig,
+ {
+ id: "trackFormInteractions",
+ label: t("Form Interactions"),
+ description: t("Automatically track form submissions and input/select changes"),
+ value: toggleStates.trackFormInteractions,
+ key: "trackFormInteractions",
+ enabledMessage: t("Form interaction tracking enabled"),
+ disabledMessage: t("Form interaction tracking disabled"),
+ disabled: standardFeaturesDisabled,
+ badge: <Badge variant="success">Standard</Badge>,
+ } as ToggleConfig,
+ ]
+ : []),
];
const renderToggleSection = (toggles: ToggleConfig[], title: string) => (
diff --git a/client/src/lib/configs.ts b/client/src/lib/configs.ts
index 7dd9e7746..2272fa269 100644
--- a/client/src/lib/configs.ts
+++ b/client/src/lib/configs.ts
@@ -4,6 +4,7 @@ import { authedFetch } from "../api/utils";
interface Configs {
disableSignup: boolean;
mapboxToken: string;
+ liteDashboard: boolean;
}
export function useConfigs() {
diff --git a/client/src/lib/const.ts b/client/src/lib/const.ts
index a3715541d..be835a7d2 100644
--- a/client/src/lib/const.ts
+++ b/client/src/lib/const.ts
@@ -3,7 +3,11 @@ export const BACKEND_URL =
? "http://localhost:3001/api"
: `${process.env.NEXT_PUBLIC_BACKEND_URL}/api`;
export const STRIPE_PUBLISHABLE_KEY = process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY ?? "";
+
+
export const IS_CLOUD = process.env.NEXT_PUBLIC_CLOUD === "true";
+export const DEPLOYMENT = process.env.NEXT_PUBLIC_DEPLOYMENT;
+export const LITE_DASHBOARD = process.env.NEXT_PUBLIC_LITE_DASHBOARD === "true";
// Time constants
export const MINUTES_IN_24_HOURS = 24 * 60; // 1440 minutes
diff --git a/client/src/lib/store.ts b/client/src/lib/store.ts
index 4df4cc804..d0c656b96 100644
--- a/client/src/lib/store.ts
+++ b/client/src/lib/store.ts
@@ -3,6 +3,13 @@ import { DateTime } from "luxon";
import { create } from "zustand";
import { persist } from "zustand/middleware";
import { Time } from "../components/DateSelector/types";
+import { LITE_DASHBOARD } from "./const";
+
+// The lite dashboard is backed by hourly materialized views, so anything finer
+// than an hour has no underlying data. Clamp auto-selected buckets up to "hour".
+const SUB_HOUR_BUCKETS: TimeBucket[] = ["minute", "five_minutes", "ten_minutes", "fifteen_minutes"];
+const clampBucketForLite = (bucket: TimeBucket): TimeBucket =>
+ LITE_DASHBOARD && SUB_HOUR_BUCKETS.includes(bucket) ? "hour" : bucket;
// Get system timezone
const getSystemTimezone = () =>
@@ -283,7 +290,7 @@ export const useStore = create<Store, [["zustand/persist", PersistedStore]]>(
}
if (changeBucket) {
- set({ time, previousTime, bucket: bucketToUse });
+ set({ time, previousTime, bucket: clampBucketForLite(bucketToUse) });
} else {
set({ time, previousTime });
}
diff --git a/docker-compose.yml b/docker-compose.yml
index cacb6116a..2f2999c91 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -62,13 +62,15 @@ services:
retries: 5
start_period: 10s
restart: unless-stopped
+ ports:
+ - "5432:5432"
backend:
image: ghcr.io/rybbit-io/rybbit-backend:${IMAGE_TAG:-latest}
container_name: backend
build:
context: .
- dockerfile: server/Dockerfile
+ dockerfile: ./server/Dockerfile
ports:
- "${HOST_BACKEND_PORT:-127.0.0.1:3001:3001}"
environment:
@@ -86,6 +88,9 @@ services:
- DISABLE_SIGNUP=${DISABLE_SIGNUP}
- DISABLE_TELEMETRY=${DISABLE_TELEMETRY}
- MAPBOX_TOKEN=${MAPBOX_TOKEN}
+ - CLUSTER_WORKERS=${CLUSTER_WORKERS:-4}
+ - DEPLOYMENT=${DEPLOYMENT}
+ - LITE_DASHBOARD=${LITE_DASHBOARD}
depends_on:
clickhouse:
condition: service_healthy
@@ -104,16 +109,19 @@ services:
container_name: client
build:
context: .
- dockerfile: client/Dockerfile
+ dockerfile: ./client/Dockerfile
args:
NEXT_PUBLIC_BACKEND_URL: ${BASE_URL}
NEXT_PUBLIC_DISABLE_SIGNUP: ${DISABLE_SIGNUP}
+ NEXT_PUBLIC_LITE_DASHBOARD: ${LITE_DASHBOARD}
ports:
- "${HOST_CLIENT_PORT:-127.0.0.1:3002:3002}"
environment:
- NODE_ENV=production
- NEXT_PUBLIC_BACKEND_URL=${BASE_URL}
- NEXT_PUBLIC_DISABLE_SIGNUP=${DISABLE_SIGNUP}
+ - NEXT_PUBLIC_DEPLOYMENT=${DEPLOYMENT}
+ - NEXT_PUBLIC_LITE_DASHBOARD=${LITE_DASHBOARD}
depends_on:
- backend
restart: unless-stopped
diff --git a/docs/content/docs/sdks/meta.json b/docs/content/docs/sdks/meta.json
index 7bf725092..546713caf 100644
--- a/docs/content/docs/sdks/meta.json
+++ b/docs/content/docs/sdks/meta.json
@@ -2,6 +2,7 @@
"title": "SDKs",
"pages": [
"web",
+ "react-native",
"node"
]
-}
\ No newline at end of file
+}
diff --git a/docs/content/docs/sdks/react-native.mdx b/docs/content/docs/sdks/react-native.mdx
new file mode 100644
index 000000000..72dbdadec
--- /dev/null
+++ b/docs/content/docs/sdks/react-native.mdx
@@ -0,0 +1,49 @@
+---
+title: React Native
+description: Official React Native SDK for Rybbit Analytics
+---
+
+## Installation
+
+```bash
+npm install @rybbit/react-native @react-native-async-storage/async-storage
+```
+
+## Initialization
+
+```tsx
+import AsyncStorage from "@react-native-async-storage/async-storage";
+import rybbit from "@rybbit/react-native";
+
+await rybbit.init({
+ analyticsHost: "https://app.rybbit.io/api",
+ siteId: "1",
+ appIdentifier: "com.example.app",
+ storage: AsyncStorage,
+ initialScreenName: "Home",
+});
+```
+
+## Track Events
+
+```tsx
+await rybbit.event("signup_started", { plan: "pro" });
+await rybbit.identify("user_123", { plan: "pro" });
+await rybbit.error(error);
+```
+
+## React Navigation
+
+```tsx
+const navigationTracker = rybbit.createNavigationTracker();
+
+<NavigationContainer
+ ref={navigationRef}
+ onReady={() => navigationTracker.onReady(navigationRef.current)}
+ onStateChange={() => navigationTracker.onStateChange(navigationRef.current)}
+>
+ {/* screens */}
+</NavigationContainer>
+```
+
+Session replay and Web Vitals are web-only features and are not available for React Native apps.
diff --git a/docs/messages/de.json b/docs/messages/de.json
index 3cd606576..7fd60525d 100644
--- a/docs/messages/de.json
+++ b/docs/messages/de.json
@@ -326,7 +326,7 @@
"DXEfMv": "Exportieren Sie Ihre Rohdaten jederzeit. Kein Vendor-Lock-in.",
"OzJhnO": "Automatisierte Berichte direkt in Ihren Posteingang.",
"oScozr": "Websites und Team-Zugänge an einem Ort verwalten.",
- "RnP+1g": "Vertraut von über 4.000 Organisationen weltweit",
+ "gpZ2SY": "",
"nkbZhS": "Warum Rybbit",
"zvwLaK": "Alles, was Sie brauchen",
"r5zJKU": "Leistungsstarke Analytics ohne Komplexität. Datenschutzfreundliche Tools, die einfach funktionieren.",
diff --git a/docs/messages/en.json b/docs/messages/en.json
index 55f9d1684..c9afcb84e 100644
--- a/docs/messages/en.json
+++ b/docs/messages/en.json
@@ -326,7 +326,7 @@
"DXEfMv": "Export your raw data anytime. No lock-in.",
"OzJhnO": "Automated reports delivered to your inbox.",
"oScozr": "Manage sites and team access in one place.",
- "RnP+1g": "Trusted by 4,000+ organizations worldwide",
+ "gpZ2SY": "Trusted by 10,000+ organizations worldwide",
"nkbZhS": "Why Rybbit",
"zvwLaK": "Everything you need",
"r5zJKU": "Powerful analytics without the complexity. Privacy-friendly tools that just work.",
diff --git a/docs/messages/es.json b/docs/messages/es.json
index 9630e7552..5ee13aa55 100644
--- a/docs/messages/es.json
+++ b/docs/messages/es.json
@@ -326,7 +326,7 @@
"DXEfMv": "Exporta tus datos sin procesar en cualquier momento. Sin dependencia del proveedor.",
"OzJhnO": "Informes automatizados entregados en tu bandeja de entrada.",
"oScozr": "Gestiona sitios y acceso del equipo en un solo lugar.",
- "RnP+1g": "Con la confianza de más de 4,000 organizaciones en todo el mundo",
+ "gpZ2SY": "",
"nkbZhS": "Por qué Rybbit",
"zvwLaK": "Todo lo que necesitas",
"r5zJKU": "Análisis potentes sin la complejidad. Herramientas respetuosas de la privacidad que simplemente funcionan.",
diff --git a/docs/messages/fr.json b/docs/messages/fr.json
index 6c90194ab..c4e495f96 100644
--- a/docs/messages/fr.json
+++ b/docs/messages/fr.json
@@ -326,7 +326,7 @@
"DXEfMv": "Exportez vos données brutes à tout moment. Sans verrouillage propriétaire.",
"OzJhnO": "Rapports automatisés livrés dans votre boîte de réception.",
"oScozr": "Gérez vos sites et les accès de votre équipe en un seul endroit.",
- "RnP+1g": "Approuvé par plus de 4 000 organisations dans le monde",
+ "gpZ2SY": "",
"nkbZhS": "Pourquoi Rybbit",
"zvwLaK": "Tout ce dont vous avez besoin",
"r5zJKU": "Des analyses puissantes sans la complexité. Des outils respectueux de la vie privée qui fonctionnent simplement.",
diff --git a/docs/messages/it.json b/docs/messages/it.json
index 7a5af2dca..6b9f12fb3 100644
--- a/docs/messages/it.json
+++ b/docs/messages/it.json
@@ -326,7 +326,7 @@
"DXEfMv": "Esporta i tuoi dati grezzi in qualsiasi momento. Nessun blocco.",
"OzJhnO": "Report automatizzati consegnati nella tua casella di posta.",
"oScozr": "Gestisci siti e accesso del team in un unico posto.",
- "RnP+1g": "Scelto da oltre 4.000 organizzazioni in tutto il mondo",
+ "gpZ2SY": "",
"nkbZhS": "Perché Rybbit",
"zvwLaK": "Tutto ciò di cui hai bisogno",
"r5zJKU": "Analisi potente senza complessità. Strumenti rispettosi della privacy che funzionano semplicemente.",
diff --git a/docs/messages/ja.json b/docs/messages/ja.json
index 46860e406..e0f9669a7 100644
--- a/docs/messages/ja.json
+++ b/docs/messages/ja.json
@@ -326,7 +326,7 @@
"DXEfMv": "いつでも生データをエクスポート。ロックインなし。",
"OzJhnO": "自動化されたレポートがインボックスに届きます。",
"oScozr": "サイトとチームアクセスを一か所で管理します。",
- "RnP+1g": "世界中の4,000以上の組織に信頼されています",
+ "gpZ2SY": "",
"nkbZhS": "Rybbitを選ぶ理由",
"zvwLaK": "必要なすべてが揃っています",
"r5zJKU": "複雑さのない強力な分析。そのまま機能するプライバシーに配慮したツール。",
diff --git a/docs/messages/ko.json b/docs/messages/ko.json
index 329a49c62..fcd5a1f72 100644
--- a/docs/messages/ko.json
+++ b/docs/messages/ko.json
@@ -326,7 +326,7 @@
"DXEfMv": "언제든지 원시 데이터를 내보내세요. 종속성 없음.",
"OzJhnO": "받은편지함으로 자동 리포트를 제공합니다.",
"oScozr": "한 곳에서 사이트와 팀 액세스를 관리하세요.",
- "RnP+1g": "전 세계 4,000개 이상의 조직이 신뢰합니다",
+ "gpZ2SY": "",
"nkbZhS": "Rybbit을 선택하는 이유",
"zvwLaK": "필요한 모든 것",
"r5zJKU": "복잡함 없는 강력한 분석. 그냥 작동하는 프라이버시 친화적인 도구.",
diff --git a/docs/messages/pl.json b/docs/messages/pl.json
index f17fbca25..ab85f9c96 100644
--- a/docs/messages/pl.json
+++ b/docs/messages/pl.json
@@ -326,7 +326,7 @@
"DXEfMv": "Eksportuj swoje surowe dane w dowolnym momencie. Brak uzależnienia od dostawcy.",
"OzJhnO": "Automatyczne raporty dostarczane do Twojej skrzynki.",
"oScozr": "Zarządzaj witrynami i dostępem zespołu w jednym miejscu.",
- "RnP+1g": "Zaufana przez ponad 4000 organizacji na całym świecie",
+ "gpZ2SY": "",
"nkbZhS": "Dlaczego Rybbit",
"zvwLaK": "Wszystko, czego potrzebujesz",
"r5zJKU": "Potężna analityka bez zbędnej złożoności. Przyjazne prywatności narzędzia, które po prostu działają.",
diff --git a/docs/messages/pt.json b/docs/messages/pt.json
index 9c46dc0e7..9bb939bc1 100644
--- a/docs/messages/pt.json
+++ b/docs/messages/pt.json
@@ -326,7 +326,7 @@
"DXEfMv": "Exporte seus dados brutos a qualquer momento. Sem aprisionamento tecnológico.",
"OzJhnO": "Relatórios automatizados entregues na sua caixa de entrada.",
"oScozr": "Gerencie sites e acesso da equipe em um único lugar.",
- "RnP+1g": "Confiado por mais de 4.000 organizações em todo o mundo",
+ "gpZ2SY": "",
"nkbZhS": "Por que Rybbit",
"zvwLaK": "Tudo que você precisa",
"r5zJKU": "Análises poderosas sem a complexidade. Ferramentas que respeitam a privacidade e simplesmente funcionam.",
diff --git a/docs/messages/zh.json b/docs/messages/zh.json
index 426bcebea..ccadfd2c2 100644
--- a/docs/messages/zh.json
+++ b/docs/messages/zh.json
@@ -326,7 +326,7 @@
"DXEfMv": "随时导出原始数据,无供应商锁定。",
"OzJhnO": "自动将报告发送至您的邮箱。",
"oScozr": "在一处管理网站和团队访问权限。",
- "RnP+1g": "全球 4,000+ 家组织信赖之选",
+ "gpZ2SY": "",
"nkbZhS": "选择 Rybbit 的理由",
"zvwLaK": "一应俱全",
"r5zJKU": "强大的分析能力,无需复杂操作。隐私友好的工具,开箱即用。",
diff --git a/react-native/README.md b/react-native/README.md
new file mode 100644
index 000000000..80ec1ee6e
--- /dev/null
+++ b/react-native/README.md
@@ -0,0 +1,43 @@
+# @rybbit/react-native
+
+React Native analytics SDK for Rybbit.
+
+## Install
+
+```sh
+npm install @rybbit/react-native @react-native-async-storage/async-storage
+```
+
+## Usage
+
+```ts
+import AsyncStorage from "@react-native-async-storage/async-storage";
+import rybbit from "@rybbit/react-native";
+
+await rybbit.init({
+ analyticsHost: "https://app.rybbit.io/api",
+ siteId: "your-site-id",
+ appIdentifier: "com.example.app",
+ storage: AsyncStorage,
+ initialScreenName: "Home",
+});
+
+await rybbit.event("signup_started", { plan: "pro" });
+await rybbit.identify("user_123", { plan: "pro" });
+```
+
+## React Navigation
+
+```tsx
+const navigationTracker = rybbit.createNavigationTracker();
+
+<NavigationContainer
+ ref={navigationRef}
+ onReady={() => navigationTracker.onReady(navigationRef.current)}
+ onStateChange={() => navigationTracker.onStateChange(navigationRef.current)}
+>
+ {/* screens */}
+</NavigationContainer>;
+```
+
+The SDK uses a generated anonymous install ID stored through the provided storage adapter. Pass AsyncStorage or a compatible storage object for persistence across app launches.
diff --git a/react-native/index.d.ts b/react-native/index.d.ts
new file mode 100644
index 000000000..30939d029
--- /dev/null
+++ b/react-native/index.d.ts
@@ -0,0 +1,75 @@
+export type RybbitStorage = {
+ getItem(key: string): Promise<string | null> | string | null;
+ setItem(key: string, value: string): Promise<void> | void;
+ removeItem(key: string): Promise<void> | void;
+};
+
+export type RybbitConfig = {
+ analyticsHost: string;
+ siteId: string | number;
+ appIdentifier?: string;
+ bundleId?: string;
+ appVersion?: string;
+ tag?: string;
+ storage?: RybbitStorage;
+ storageKeyPrefix?: string;
+ debug?: boolean;
+ autoTrackAppLifecycle?: boolean;
+ initialScreenName?: string;
+ configTimeoutMs?: number;
+ maxQueueSize?: number;
+ fetch?: typeof fetch;
+};
+
+export type TrackContext = {
+ appIdentifier?: string;
+ pathname?: string;
+ querystring?: string;
+ screen?: string;
+ title?: string;
+ referrer?: string;
+ language?: string;
+ userAgent?: string;
+};
+
+export type TrackProperties = Record<string, unknown>;
+
+export type NavigationRoute = {
+ name?: string;
+ path?: string;
+ params?: Record<string, unknown>;
+};
+
+export type NavigationRef = {
+ getCurrentRoute?: () => NavigationRoute | undefined;
+};
+
+export type NavigationTrackerOptions = {
+ includeRouteParams?: boolean;
+ getRouteName?: (route: NavigationRoute | undefined) => string;
+ getPath?: (route: NavigationRoute | undefined) => string;
+};
+
+export type NavigationTracker = {
+ onReady(navigationRef: NavigationRef): Promise<void>;
+ onStateChange(navigationRef: NavigationRef): Promise<void>;
+ trackCurrentRoute(navigationRef: NavigationRef): Promise<void>;
+};
+
+export class RybbitReactNative {
+ init(config: RybbitConfig): Promise<void>;
+ screen(name: string, properties?: TrackProperties, context?: TrackContext): Promise<void>;
+ pageview(path?: string, context?: TrackContext): Promise<void>;
+ event(name: string, properties?: TrackProperties, context?: TrackContext): Promise<void>;
+ error(error: Error | unknown, properties?: TrackProperties, context?: TrackContext): Promise<void>;
+ identify(userId: string, traits?: Record<string, unknown>): Promise<void>;
+ setTraits(traits: Record<string, unknown>): Promise<void>;
+ clearUserId(): Promise<void>;
+ getUserId(): string | null;
+ flush(): Promise<void>;
+ createNavigationTracker(options?: NavigationTrackerOptions): NavigationTracker;
+ cleanup(): void;
+}
+
+declare const rybbit: RybbitReactNative;
+export default rybbit;
diff --git a/react-native/index.js b/react-native/index.js
new file mode 100644
index 000000000..84b44871a
--- /dev/null
+++ b/react-native/index.js
@@ -0,0 +1,427 @@
+"use strict";
+
+const SDK_VERSION = "0.1.0";
+const DEFAULT_CONFIG_TIMEOUT_MS = 3000;
+const DEFAULT_MAX_QUEUE_SIZE = 100;
+
+let ReactNativeModule;
+
+function getReactNative() {
+ if (!ReactNativeModule) {
+ ReactNativeModule = require("react-native");
+ }
+ return ReactNativeModule;
+}
+
+function trimTrailingSlash(value) {
+ return value.replace(/\/+$/, "");
+}
+
+function createMemoryStorage() {
+ const values = new Map();
+ return {
+ async getItem(key) {
+ return values.has(key) ? values.get(key) : null;
+ },
+ async setItem(key, value) {
+ values.set(key, value);
+ },
+ async removeItem(key) {
+ values.delete(key);
+ },
+ };
+}
+
+function generateId() {
+ const randomPart = Math.random().toString(36).slice(2);
+ const timePart = Date.now().toString(36);
+ return `rn_${timePart}_${randomPart}`;
+}
+
+function withTimeout(promise, timeoutMs) {
+ let timeoutId;
+ const timeout = new Promise((_, reject) => {
+ timeoutId = setTimeout(() => reject(new Error("Request timed out")), timeoutMs);
+ });
+ return Promise.race([promise, timeout]).finally(() => clearTimeout(timeoutId));
+}
+
+function asPathname(path) {
+ if (!path) return "/";
+ const value = String(path).trim();
+ if (!value) return "/";
+ return value.startsWith("/") ? value : `/${value}`;
+}
+
+function getLanguage() {
+ try {
+ const { NativeModules, Platform } = getReactNative();
+ if (Platform.OS === "ios") {
+ const settings = NativeModules.SettingsManager?.settings || {};
+ return settings.AppleLocale || settings.AppleLanguages?.[0] || "";
+ }
+ return NativeModules.I18nManager?.localeIdentifier || "";
+ } catch {
+ return "";
+ }
+}
+
+function getScreenSize() {
+ try {
+ const { Dimensions } = getReactNative();
+ const screen = Dimensions.get("screen");
+ return {
+ screenWidth: Math.max(1, Math.round(screen.width || 0)),
+ screenHeight: Math.max(1, Math.round(screen.height || 0)),
+ };
+ } catch {
+ return {
+ screenWidth: 1,
+ screenHeight: 1,
+ };
+ }
+}
+
+function getUserAgent(appVersion) {
+ try {
+ const { Platform } = getReactNative();
+ if (Platform.OS === "android") {
+ const version = Platform.Version || "";
+ return `Mozilla/5.0 (Linux; Android ${version}) AppleWebKit/537.36 (KHTML, like Gecko) RybbitReactNative/${SDK_VERSION}${appVersion ? ` ${appVersion}` : ""}`;
+ }
+ if (Platform.OS === "ios") {
+ const version = String(Platform.Version || "").replace(/\./g, "_");
+ return `Mozilla/5.0 (iPhone; CPU iPhone OS ${version} like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) RybbitReactNative/${SDK_VERSION}${appVersion ? ` ${appVersion}` : ""}`;
+ }
+ return `RybbitReactNative/${SDK_VERSION} (${Platform.OS})${appVersion ? ` ${appVersion}` : ""}`;
+ } catch {
+ return `RybbitReactNative/${SDK_VERSION}`;
+ }
+}
+
+class RybbitReactNative {
+ constructor() {
+ this.config = null;
+ this.remoteConfig = {};
+ this.storage = createMemoryStorage();
+ this.anonymousId = null;
+ this.userId = null;
+ this.queue = [];
+ this.appStateSubscription = null;
+ }
+
+ async init(config) {
+ if (!config || !config.analyticsHost || !config.siteId) {
+ throw new Error("analyticsHost and siteId are required");
+ }
+
+ this.config = {
+ analyticsHost: trimTrailingSlash(config.analyticsHost),
+ siteId: String(config.siteId),
+ appIdentifier: config.appIdentifier || config.bundleId || "",
+ appVersion: config.appVersion || "",
+ tag: config.tag || "",
+ storageKeyPrefix: config.storageKeyPrefix || "@rybbit",
+ debug: !!config.debug,
+ autoTrackAppLifecycle: config.autoTrackAppLifecycle !== false,
+ initialScreenName: config.initialScreenName || "",
+ configTimeoutMs: config.configTimeoutMs || DEFAULT_CONFIG_TIMEOUT_MS,
+ maxQueueSize: config.maxQueueSize || DEFAULT_MAX_QUEUE_SIZE,
+ fetch: config.fetch || (typeof fetch === "function" ? fetch : undefined),
+ };
+ this.storage = config.storage || createMemoryStorage();
+
+ this.anonymousId = await this.getOrCreateAnonymousId();
+ this.userId = await this.storage.getItem(this.storageKey("user-id"));
+ this.remoteConfig = await this.fetchRemoteConfig();
+
+ if (this.config.autoTrackAppLifecycle) {
+ this.setupAppLifecycleTracking();
+ }
+
+ if (this.config.initialScreenName && this.remoteConfig.trackInitialPageView !== false) {
+ await this.screen(this.config.initialScreenName);
+ }
+
+ await this.flush();
+ }
+
+ storageKey(name) {
+ return `${this.config.storageKeyPrefix}:${this.config.siteId}:${name}`;
+ }
+
+ async getOrCreateAnonymousId() {
+ const key = this.storageKey("anonymous-id");
+ const existing = await this.storage.getItem(key);
+ if (existing) return existing;
+
+ const nextId = generateId();
+ await this.storage.setItem(key, nextId);
+ return nextId;
+ }
+
+ async fetchRemoteConfig() {
+ try {
+ const response = await withTimeout(
+ this.config.fetch(`${this.config.analyticsHost}/site/tracking-config/${this.config.siteId}`, {
+ method: "GET",
+ }),
+ this.config.configTimeoutMs
+ );
+ if (!response.ok) return {};
+ return await response.json();
+ } catch (error) {
+ this.debug("Failed to fetch tracking config", error);
+ return {};
+ }
+ }
+
+ setupAppLifecycleTracking() {
+ try {
+ const { AppState } = getReactNative();
+ let previousState = AppState.currentState;
+
+ if (previousState === "active") {
+ this.event("app_open").catch(error => this.debug("Failed to track app_open", error));
+ }
+
+ this.appStateSubscription?.remove?.();
+ this.appStateSubscription = AppState.addEventListener("change", nextState => {
+ if (previousState !== "active" && nextState === "active") {
+ this.event("app_open").catch(error => this.debug("Failed to track app_open", error));
+ } else if (previousState === "active" && nextState !== "active") {
+ this.event("app_background", { state: nextState }).catch(error =>
+ this.debug("Failed to track app_background", error)
+ );
+ }
+ previousState = nextState;
+ });
+ } catch (error) {
+ this.debug("Failed to setup AppState tracking", error);
+ }
+ }
+
+ createBasePayload(context) {
+ this.ensureInitialized();
+ const screenSize = getScreenSize();
+ const appIdentifier = context?.appIdentifier || this.config.appIdentifier || this.config.siteId;
+
+ const payload = {
+ site_id: this.config.siteId,
+ anonymous_id: this.anonymousId,
+ hostname: appIdentifier,
+ pathname: asPathname(context?.pathname || context?.screen || "/"),
+ querystring: context?.querystring || "",
+ screenWidth: screenSize.screenWidth,
+ screenHeight: screenSize.screenHeight,
+ language: context?.language || getLanguage(),
+ page_title: context?.title || context?.screen || "",
+ referrer: context?.referrer || "",
+ user_agent: context?.userAgent || getUserAgent(this.config.appVersion),
+ };
+
+ if (this.userId) payload.user_id = this.userId;
+ if (this.config.tag) payload.tag = this.config.tag;
+
+ return payload;
+ }
+
+ async send(payload) {
+ this.ensureInitialized();
+ try {
+ const response = await this.config.fetch(`${this.config.analyticsHost}/track`, {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify(payload),
+ });
+
+ if (!response.ok) {
+ throw new Error(`Tracking request failed with ${response.status}`);
+ }
+ } catch (error) {
+ this.enqueue(payload);
+ this.debug("Failed to send tracking payload", error);
+ }
+ }
+
+ enqueue(payload) {
+ this.queue.push(payload);
+ if (this.queue.length > this.config.maxQueueSize) {
+ this.queue.shift();
+ }
+ }
+
+ async flush() {
+ this.ensureInitialized();
+ if (this.queue.length === 0) return;
+
+ const queued = [...this.queue];
+ this.queue = [];
+ for (const payload of queued) {
+ await this.send(payload);
+ }
+ }
+
+ async track(type, eventName, properties, context) {
+ const payload = {
+ ...this.createBasePayload(context),
+ type,
+ event_name: eventName || "",
+ };
+
+ if (properties && Object.keys(properties).length > 0) {
+ payload.properties = JSON.stringify(properties);
+ }
+
+ await this.send(payload);
+ }
+
+ async screen(name, properties, context) {
+ const pathname = context?.pathname || asPathname(name);
+ await this.track("pageview", "", properties, {
+ ...context,
+ screen: name,
+ pathname,
+ title: context?.title || name,
+ });
+ }
+
+ async pageview(path, context) {
+ await this.track("pageview", "", undefined, {
+ ...context,
+ pathname: path || context?.pathname || "/",
+ title: context?.title || "",
+ });
+ }
+
+ async event(name, properties, context) {
+ if (!name || typeof name !== "string") {
+ throw new Error("Event name is required and must be a string");
+ }
+ await this.track("custom_event", name, properties || {}, context);
+ }
+
+ async error(error, properties, context) {
+ if (this.remoteConfig.trackErrors === false) return;
+ const err = error instanceof Error ? error : new Error(String(error));
+ await this.track(
+ "error",
+ err.name || "Error",
+ {
+ message: String(err.message || "Unknown error").slice(0, 500),
+ stack: String(err.stack || "").slice(0, 2000),
+ ...(properties || {}),
+ },
+ context
+ );
+ }
+
+ async identify(userId, traits) {
+ this.ensureInitialized();
+ if (!userId || typeof userId !== "string") {
+ throw new Error("User ID must be a non-empty string");
+ }
+
+ this.userId = userId.trim();
+ await this.storage.setItem(this.storageKey("user-id"), this.userId);
+
+ await this.sendIdentify(this.userId, traits, true);
+ }
+
+ async setTraits(traits) {
+ this.ensureInitialized();
+ if (!this.userId) {
+ throw new Error("Cannot set traits without identifying user first");
+ }
+ await this.sendIdentify(this.userId, traits || {}, false);
+ }
+
+ async sendIdentify(userId, traits, isNewIdentify) {
+ try {
+ const response = await this.config.fetch(`${this.config.analyticsHost}/identify`, {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify({
+ site_id: this.config.siteId,
+ anonymous_id: this.anonymousId,
+ user_id: userId,
+ traits,
+ is_new_identify: isNewIdentify,
+ user_agent: getUserAgent(this.config.appVersion),
+ }),
+ });
+
+ if (!response.ok) {
+ throw new Error(`Identify request failed with ${response.status}`);
+ }
+ } catch (error) {
+ this.debug("Failed to send identify payload", error);
+ }
+ }
+
+ async clearUserId() {
+ this.ensureInitialized();
+ this.userId = null;
+ await this.storage.removeItem(this.storageKey("user-id"));
+ }
+
+ getUserId() {
+ return this.userId;
+ }
+
+ createNavigationTracker(options) {
+ let previousRouteName = null;
+ const client = this;
+ const getRouteName = options?.getRouteName || (route => route?.name || "");
+ const getPath = options?.getPath || (route => route?.path || route?.name || "");
+ const includeRouteParams = !!options?.includeRouteParams;
+
+ const trackCurrentRoute = async navigationRef => {
+ const route = navigationRef?.getCurrentRoute?.();
+ const routeName = getRouteName(route);
+ if (!routeName || routeName === previousRouteName) return;
+
+ previousRouteName = routeName;
+ await client.screen(routeName, includeRouteParams && route?.params ? { routeParams: route.params } : undefined, {
+ pathname: asPathname(getPath(route)),
+ screen: routeName,
+ });
+ };
+
+ return {
+ onReady: trackCurrentRoute,
+ onStateChange: trackCurrentRoute,
+ trackCurrentRoute,
+ };
+ }
+
+ cleanup() {
+ this.appStateSubscription?.remove?.();
+ this.appStateSubscription = null;
+ }
+
+ ensureInitialized() {
+ if (!this.config || !this.anonymousId) {
+ throw new Error("rybbit.init() must be called before tracking");
+ }
+ if (typeof this.config.fetch !== "function") {
+ throw new Error("No fetch implementation is available");
+ }
+ }
+
+ debug(message, error) {
+ if (this.config?.debug) {
+ console.warn(`[Rybbit] ${message}`, error);
+ }
+ }
+}
+
+const defaultClient = new RybbitReactNative();
+
+module.exports = defaultClient;
+module.exports.default = defaultClient;
+module.exports.RybbitReactNative = RybbitReactNative;
diff --git a/react-native/package.json b/react-native/package.json
new file mode 100644
index 000000000..4de59b1dc
--- /dev/null
+++ b/react-native/package.json
@@ -0,0 +1,24 @@
+{
+ "name": "@rybbit/react-native",
+ "version": "0.1.0",
+ "description": "React Native analytics SDK for Rybbit",
+ "main": "index.js",
+ "types": "index.d.ts",
+ "files": [
+ "index.js",
+ "index.d.ts",
+ "README.md"
+ ],
+ "keywords": [
+ "analytics",
+ "react-native",
+ "rybbit"
+ ],
+ "peerDependencies": {
+ "react-native": ">=0.72.0"
+ },
+ "publishConfig": {
+ "access": "public"
+ },
+ "license": "MIT"
+}
diff --git a/server/drizzle/0007_site_type.sql b/server/drizzle/0007_site_type.sql
new file mode 100644
index 000000000..7685984ad
--- /dev/null
+++ b/server/drizzle/0007_site_type.sql
@@ -0,0 +1,6 @@
+ALTER TABLE "sites" ADD COLUMN IF NOT EXISTS "type" text;--> statement-breakpoint
+DO $$ BEGIN
+ALTER TABLE "sites" ADD CONSTRAINT "sites_type_check" CHECK ("type" IS NULL OR "type" IN ('web', 'mobile'));
+EXCEPTION
+WHEN duplicate_object THEN null;
+END $$;
diff --git a/server/drizzle/meta/0006_snapshot.json b/server/drizzle/meta/0006_snapshot.json
index efd5d4771..fa78d17cf 100644
--- a/server/drizzle/meta/0006_snapshot.json
+++ b/server/drizzle/meta/0006_snapshot.json
@@ -3252,4 +3252,4 @@
"schemas": {},
"tables": {}
}
-}
\ No newline at end of file
+}
diff --git a/server/drizzle/meta/0007_snapshot.json b/server/drizzle/meta/0007_snapshot.json
new file mode 100644
index 000000000..cd42f91b8
--- /dev/null
+++ b/server/drizzle/meta/0007_snapshot.json
@@ -0,0 +1,3266 @@
+{
+ "id": "3987804d-997b-4f52-aeaa-60f3c38025d2",
+ "prevId": "662aeef8-8f3e-4c11-becb-a2cef1b972ef",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.account": {
+ "name": "account",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "accountId": {
+ "name": "accountId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "providerId": {
+ "name": "providerId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "userId": {
+ "name": "userId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "accessToken": {
+ "name": "accessToken",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refreshToken": {
+ "name": "refreshToken",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "idToken": {
+ "name": "idToken",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "accessTokenExpiresAt": {
+ "name": "accessTokenExpiresAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refreshTokenExpiresAt": {
+ "name": "refreshTokenExpiresAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "createdAt": {
+ "name": "createdAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updatedAt": {
+ "name": "updatedAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "account_userId_user_id_fk": {
+ "name": "account_userId_user_id_fk",
+ "tableFrom": "account",
+ "tableTo": "user",
+ "columnsFrom": [
+ "userId"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.active_sessions": {
+ "name": "active_sessions",
+ "schema": "",
+ "columns": {
+ "session_id": {
+ "name": "session_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "site_id": {
+ "name": "site_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "start_time": {
+ "name": "start_time",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ },
+ "last_activity": {
+ "name": "last_activity",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.agent_regions": {
+ "name": "agent_regions",
+ "schema": "",
+ "columns": {
+ "code": {
+ "name": "code",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "endpoint_url": {
+ "name": "endpoint_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "last_health_check": {
+ "name": "last_health_check",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_healthy": {
+ "name": "is_healthy",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.apikey": {
+ "name": "apikey",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "start": {
+ "name": "start",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "prefix": {
+ "name": "prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "referenceId": {
+ "name": "referenceId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "refillInterval": {
+ "name": "refillInterval",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refillAmount": {
+ "name": "refillAmount",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lastRefillAt": {
+ "name": "lastRefillAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "rateLimitEnabled": {
+ "name": "rateLimitEnabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "rateLimitTimeWindow": {
+ "name": "rateLimitTimeWindow",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rateLimitMax": {
+ "name": "rateLimitMax",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requestCount": {
+ "name": "requestCount",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "remaining": {
+ "name": "remaining",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lastRequest": {
+ "name": "lastRequest",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expiresAt": {
+ "name": "expiresAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "createdAt": {
+ "name": "createdAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updatedAt": {
+ "name": "updatedAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "configId": {
+ "name": "configId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "permissions": {
+ "name": "permissions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "apikey_referenceId_user_id_fk": {
+ "name": "apikey_referenceId_user_id_fk",
+ "tableFrom": "apikey",
+ "tableTo": "user",
+ "columnsFrom": [
+ "referenceId"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.cancellation_feedback": {
+ "name": "cancellation_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "organization_id": {
+ "name": "organization_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "reason": {
+ "name": "reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "reason_details": {
+ "name": "reason_details",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "retention_offer_shown": {
+ "name": "retention_offer_shown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "retention_offer_accepted": {
+ "name": "retention_offer_accepted",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "outcome": {
+ "name": "outcome",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "plan_name_at_cancellation": {
+ "name": "plan_name_at_cancellation",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "monthly_event_count_at_cancellation": {
+ "name": "monthly_event_count_at_cancellation",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.experiments": {
+ "name": "experiments",
+ "schema": "",
+ "columns": {
+ "experiment_id": {
+ "name": "experiment_id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "site_id": {
+ "name": "site_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "feature_flag_id": {
+ "name": "feature_flag_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "primary_goal_id": {
+ "name": "primary_goal_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "hypothesis": {
+ "name": "hypothesis",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'draft'"
+ },
+ "winning_variant": {
+ "name": "winning_variant",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ended_at": {
+ "name": "ended_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "experiments_site_idx": {
+ "name": "experiments_site_idx",
+ "columns": [
+ {
+ "expression": "site_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "experiments_feature_flag_idx": {
+ "name": "experiments_feature_flag_idx",
+ "columns": [
+ {
+ "expression": "feature_flag_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "experiments_primary_goal_idx": {
+ "name": "experiments_primary_goal_idx",
+ "columns": [
+ {
+ "expression": "primary_goal_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "experiments_site_id_sites_site_id_fk": {
+ "name": "experiments_site_id_sites_site_id_fk",
+ "tableFrom": "experiments",
+ "tableTo": "sites",
+ "columnsFrom": [
+ "site_id"
+ ],
+ "columnsTo": [
+ "site_id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "experiments_feature_flag_id_feature_flags_flag_id_fk": {
+ "name": "experiments_feature_flag_id_feature_flags_flag_id_fk",
+ "tableFrom": "experiments",
+ "tableTo": "feature_flags",
+ "columnsFrom": [
+ "feature_flag_id"
+ ],
+ "columnsTo": [
+ "flag_id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "experiments_primary_goal_id_goals_goal_id_fk": {
+ "name": "experiments_primary_goal_id_goals_goal_id_fk",
+ "tableFrom": "experiments",
+ "tableTo": "goals",
+ "columnsFrom": [
+ "primary_goal_id"
+ ],
+ "columnsTo": [
+ "goal_id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "experiments_site_flag_unique": {
+ "name": "experiments_site_flag_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "site_id",
+ "feature_flag_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "experiments_status_check": {
+ "name": "experiments_status_check",
+ "value": "status IN ('draft', 'running', 'paused', 'completed')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.feature_flags": {
+ "name": "feature_flags",
+ "schema": "",
+ "columns": {
+ "flag_id": {
+ "name": "flag_id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "site_id": {
+ "name": "site_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "runtime": {
+ "name": "runtime",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'client'"
+ },
+ "flag_type": {
+ "name": "flag_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'boolean'"
+ },
+ "payload": {
+ "name": "payload",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "variants": {
+ "name": "variants",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "rollout_percentage": {
+ "name": "rollout_percentage",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 100
+ },
+ "rules": {
+ "name": "rules",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "condition_sets": {
+ "name": "condition_sets",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "salt": {
+ "name": "salt",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "md5(random()::text || clock_timestamp()::text)"
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "feature_flags_site_idx": {
+ "name": "feature_flags_site_idx",
+ "columns": [
+ {
+ "expression": "site_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "feature_flags_site_id_sites_site_id_fk": {
+ "name": "feature_flags_site_id_sites_site_id_fk",
+ "tableFrom": "feature_flags",
+ "tableTo": "sites",
+ "columnsFrom": [
+ "site_id"
+ ],
+ "columnsTo": [
+ "site_id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "feature_flags_site_key_unique": {
+ "name": "feature_flags_site_key_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "site_id",
+ "key"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {
+ "feature_flags_rollout_check": {
+ "name": "feature_flags_rollout_check",
+ "value": "rollout_percentage >= 0 AND rollout_percentage <= 100"
+ },
+ "feature_flags_runtime_check": {
+ "name": "feature_flags_runtime_check",
+ "value": "runtime IN ('client', 'server', 'both')"
+ },
+ "feature_flags_type_check": {
+ "name": "feature_flags_type_check",
+ "value": "flag_type IN ('boolean', 'multivariate', 'remote_config')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.funnels": {
+ "name": "funnels",
+ "schema": "",
+ "columns": {
+ "report_id": {
+ "name": "report_id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "site_id": {
+ "name": "site_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "data": {
+ "name": "data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "funnels_site_id_sites_site_id_fk": {
+ "name": "funnels_site_id_sites_site_id_fk",
+ "tableFrom": "funnels",
+ "tableTo": "sites",
+ "columnsFrom": [
+ "site_id"
+ ],
+ "columnsTo": [
+ "site_id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "funnels_user_id_user_id_fk": {
+ "name": "funnels_user_id_user_id_fk",
+ "tableFrom": "funnels",
+ "tableTo": "user",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.goals": {
+ "name": "goals",
+ "schema": "",
+ "columns": {
+ "goal_id": {
+ "name": "goal_id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "site_id": {
+ "name": "site_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "goal_type": {
+ "name": "goal_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "config": {
+ "name": "config",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "goals_site_id_sites_site_id_fk": {
+ "name": "goals_site_id_sites_site_id_fk",
+ "tableFrom": "goals",
+ "tableTo": "sites",
+ "columnsFrom": [
+ "site_id"
+ ],
+ "columnsTo": [
+ "site_id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.gsc_connections": {
+ "name": "gsc_connections",
+ "schema": "",
+ "columns": {
+ "site_id": {
+ "name": "site_id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "refresh_token": {
+ "name": "refresh_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "gsc_property_url": {
+ "name": "gsc_property_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "gsc_connections_site_id_sites_site_id_fk": {
+ "name": "gsc_connections_site_id_sites_site_id_fk",
+ "tableFrom": "gsc_connections",
+ "tableTo": "sites",
+ "columnsFrom": [
+ "site_id"
+ ],
+ "columnsTo": [
+ "site_id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.import_status": {
+ "name": "import_status",
+ "schema": "",
+ "columns": {
+ "import_id": {
+ "name": "import_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "site_id": {
+ "name": "site_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "organization_id": {
+ "name": "organization_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "platform": {
+ "name": "platform",
+ "type": "import_platform_enum",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "imported_events": {
+ "name": "imported_events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "skipped_events": {
+ "name": "skipped_events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "invalid_events": {
+ "name": "invalid_events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "import_status_site_id_sites_site_id_fk": {
+ "name": "import_status_site_id_sites_site_id_fk",
+ "tableFrom": "import_status",
+ "tableTo": "sites",
+ "columnsFrom": [
+ "site_id"
+ ],
+ "columnsTo": [
+ "site_id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "import_status_organization_id_organization_id_fk": {
+ "name": "import_status_organization_id_organization_id_fk",
+ "tableFrom": "import_status",
+ "tableTo": "organization",
+ "columnsFrom": [
+ "organization_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.invitation": {
+ "name": "invitation",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "inviterId": {
+ "name": "inviterId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "organizationId": {
+ "name": "organizationId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "createdAt": {
+ "name": "createdAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expiresAt": {
+ "name": "expiresAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "has_restricted_site_access": {
+ "name": "has_restricted_site_access",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "site_ids": {
+ "name": "site_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'[]'::jsonb"
+ },
+ "teamId": {
+ "name": "teamId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "invitation_inviterId_user_id_fk": {
+ "name": "invitation_inviterId_user_id_fk",
+ "tableFrom": "invitation",
+ "tableTo": "user",
+ "columnsFrom": [
+ "inviterId"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "invitation_organizationId_organization_id_fk": {
+ "name": "invitation_organizationId_organization_id_fk",
+ "tableFrom": "invitation",
+ "tableTo": "organization",
+ "columnsFrom": [
+ "organizationId"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "invitation_teamId_team_id_fk": {
+ "name": "invitation_teamId_team_id_fk",
+ "tableFrom": "invitation",
+ "tableTo": "team",
+ "columnsFrom": [
+ "teamId"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.member": {
+ "name": "member",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "organizationId": {
+ "name": "organizationId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "userId": {
+ "name": "userId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "createdAt": {
+ "name": "createdAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "has_restricted_site_access": {
+ "name": "has_restricted_site_access",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "member_organizationId_organization_id_fk": {
+ "name": "member_organizationId_organization_id_fk",
+ "tableFrom": "member",
+ "tableTo": "organization",
+ "columnsFrom": [
+ "organizationId"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "member_userId_user_id_fk": {
+ "name": "member_userId_user_id_fk",
+ "tableFrom": "member",
+ "tableTo": "user",
+ "columnsFrom": [
+ "userId"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.member_site_access": {
+ "name": "member_site_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "member_id": {
+ "name": "member_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "site_id": {
+ "name": "site_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "member_site_access_member_idx": {
+ "name": "member_site_access_member_idx",
+ "columns": [
+ {
+ "expression": "member_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "member_site_access_site_idx": {
+ "name": "member_site_access_site_idx",
+ "columns": [
+ {
+ "expression": "site_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "member_site_access_member_id_member_id_fk": {
+ "name": "member_site_access_member_id_member_id_fk",
+ "tableFrom": "member_site_access",
+ "tableTo": "member",
+ "columnsFrom": [
+ "member_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "member_site_access_site_id_sites_site_id_fk": {
+ "name": "member_site_access_site_id_sites_site_id_fk",
+ "tableFrom": "member_site_access",
+ "tableTo": "sites",
+ "columnsFrom": [
+ "site_id"
+ ],
+ "columnsTo": [
+ "site_id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "member_site_access_created_by_user_id_fk": {
+ "name": "member_site_access_created_by_user_id_fk",
+ "tableFrom": "member_site_access",
+ "tableTo": "user",
+ "columnsFrom": [
+ "created_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "member_site_access_unique": {
+ "name": "member_site_access_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "member_id",
+ "site_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.notification_channels": {
+ "name": "notification_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "organization_id": {
+ "name": "organization_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "config": {
+ "name": "config",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "monitor_ids": {
+ "name": "monitor_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "trigger_events": {
+ "name": "trigger_events",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[\"down\",\"recovery\"]'::jsonb"
+ },
+ "cooldown_minutes": {
+ "name": "cooldown_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 5
+ },
+ "last_notified_at": {
+ "name": "last_notified_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_channels_organization_id_organization_id_fk": {
+ "name": "notification_channels_organization_id_organization_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "organization",
+ "columnsFrom": [
+ "organization_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "notification_channels_created_by_user_id_fk": {
+ "name": "notification_channels_created_by_user_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "user",
+ "columnsFrom": [
+ "created_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.organization": {
+ "name": "organization",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "slug": {
+ "name": "slug",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo": {
+ "name": "logo",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "createdAt": {
+ "name": "createdAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stripeCustomerId": {
+ "name": "stripeCustomerId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "monthlyEventCount": {
+ "name": "monthlyEventCount",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "overMonthlyLimit": {
+ "name": "overMonthlyLimit",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "approachingLimitNotifiedPeriodStart": {
+ "name": "approachingLimitNotifiedPeriodStart",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "planOverride": {
+ "name": "planOverride",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "custom_plan": {
+ "name": "custom_plan",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "organization_slug_unique": {
+ "name": "organization_slug_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "slug"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session": {
+ "name": "session",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "expiresAt": {
+ "name": "expiresAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "createdAt": {
+ "name": "createdAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updatedAt": {
+ "name": "updatedAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ipAddress": {
+ "name": "ipAddress",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "userAgent": {
+ "name": "userAgent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "userId": {
+ "name": "userId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "impersonatedBy": {
+ "name": "impersonatedBy",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activeOrganizationId": {
+ "name": "activeOrganizationId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activeTeamId": {
+ "name": "activeTeamId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_userId_user_id_fk": {
+ "name": "session_userId_user_id_fk",
+ "tableFrom": "session",
+ "tableTo": "user",
+ "columnsFrom": [
+ "userId"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "session_token_unique": {
+ "name": "session_token_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "token"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sites": {
+ "name": "sites",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "site_id": {
+ "name": "site_id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "organization_id": {
+ "name": "organization_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "public": {
+ "name": "public",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "embed_enabled": {
+ "name": "embed_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "saltUserIds": {
+ "name": "saltUserIds",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "blockBots": {
+ "name": "blockBots",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "excluded_ips": {
+ "name": "excluded_ips",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'[]'::jsonb"
+ },
+ "excluded_countries": {
+ "name": "excluded_countries",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'[]'::jsonb"
+ },
+ "sessionReplay": {
+ "name": "sessionReplay",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "webVitals": {
+ "name": "webVitals",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "trackErrors": {
+ "name": "trackErrors",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "trackOutbound": {
+ "name": "trackOutbound",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "trackUrlParams": {
+ "name": "trackUrlParams",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "trackInitialPageView": {
+ "name": "trackInitialPageView",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "trackSpaNavigation": {
+ "name": "trackSpaNavigation",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "trackIp": {
+ "name": "trackIp",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "trackButtonClicks": {
+ "name": "trackButtonClicks",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "trackCopy": {
+ "name": "trackCopy",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "trackFormInteractions": {
+ "name": "trackFormInteractions",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "api_key": {
+ "name": "api_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "private_link_key": {
+ "name": "private_link_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'[]'::jsonb"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "sites_created_by_user_id_fk": {
+ "name": "sites_created_by_user_id_fk",
+ "tableFrom": "sites",
+ "tableTo": "user",
+ "columnsFrom": [
+ "created_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "sites_organization_id_organization_id_fk": {
+ "name": "sites_organization_id_organization_id_fk",
+ "tableFrom": "sites",
+ "tableTo": "organization",
+ "columnsFrom": [
+ "organization_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "sites_type_check": {
+ "name": "sites_type_check",
+ "value": "\"sites\".\"type\" IS NULL OR \"sites\".\"type\" IN ('web', 'mobile')"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.team": {
+ "name": "team",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "organizationId": {
+ "name": "organizationId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "createdAt": {
+ "name": "createdAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updatedAt": {
+ "name": "updatedAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "team_organizationId_organization_id_fk": {
+ "name": "team_organizationId_organization_id_fk",
+ "tableFrom": "team",
+ "tableTo": "organization",
+ "columnsFrom": [
+ "organizationId"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.teamMember": {
+ "name": "teamMember",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "teamId": {
+ "name": "teamId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "userId": {
+ "name": "userId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "createdAt": {
+ "name": "createdAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "teamMember_teamId_team_id_fk": {
+ "name": "teamMember_teamId_team_id_fk",
+ "tableFrom": "teamMember",
+ "tableTo": "team",
+ "columnsFrom": [
+ "teamId"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "teamMember_userId_user_id_fk": {
+ "name": "teamMember_userId_user_id_fk",
+ "tableFrom": "teamMember",
+ "tableTo": "user",
+ "columnsFrom": [
+ "userId"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.team_site_access": {
+ "name": "team_site_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "team_id": {
+ "name": "team_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "site_id": {
+ "name": "site_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "team_site_access_team_idx": {
+ "name": "team_site_access_team_idx",
+ "columns": [
+ {
+ "expression": "team_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "team_site_access_site_idx": {
+ "name": "team_site_access_site_idx",
+ "columns": [
+ {
+ "expression": "site_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "team_site_access_team_id_team_id_fk": {
+ "name": "team_site_access_team_id_team_id_fk",
+ "tableFrom": "team_site_access",
+ "tableTo": "team",
+ "columnsFrom": [
+ "team_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "team_site_access_site_id_sites_site_id_fk": {
+ "name": "team_site_access_site_id_sites_site_id_fk",
+ "tableFrom": "team_site_access",
+ "tableTo": "sites",
+ "columnsFrom": [
+ "site_id"
+ ],
+ "columnsTo": [
+ "site_id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "team_site_access_unique": {
+ "name": "team_site_access_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "team_id",
+ "site_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.telemetry": {
+ "name": "telemetry",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "instance_id": {
+ "name": "instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "version": {
+ "name": "version",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "table_counts": {
+ "name": "table_counts",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "clickhouse_size_gb": {
+ "name": "clickhouse_size_gb",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.uptime_alert_history": {
+ "name": "uptime_alert_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "alert_id": {
+ "name": "alert_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "monitor_id": {
+ "name": "monitor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "triggered_at": {
+ "name": "triggered_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "alert_data": {
+ "name": "alert_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "uptime_alert_history_alert_id_uptime_alerts_id_fk": {
+ "name": "uptime_alert_history_alert_id_uptime_alerts_id_fk",
+ "tableFrom": "uptime_alert_history",
+ "tableTo": "uptime_alerts",
+ "columnsFrom": [
+ "alert_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "uptime_alert_history_monitor_id_uptime_monitors_id_fk": {
+ "name": "uptime_alert_history_monitor_id_uptime_monitors_id_fk",
+ "tableFrom": "uptime_alert_history",
+ "tableTo": "uptime_monitors",
+ "columnsFrom": [
+ "monitor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.uptime_alerts": {
+ "name": "uptime_alerts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "monitor_id": {
+ "name": "monitor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "alert_type": {
+ "name": "alert_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "alert_config": {
+ "name": "alert_config",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conditions": {
+ "name": "conditions",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "uptime_alerts_monitor_id_uptime_monitors_id_fk": {
+ "name": "uptime_alerts_monitor_id_uptime_monitors_id_fk",
+ "tableFrom": "uptime_alerts",
+ "tableTo": "uptime_monitors",
+ "columnsFrom": [
+ "monitor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.uptime_incidents": {
+ "name": "uptime_incidents",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "organization_id": {
+ "name": "organization_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "monitor_id": {
+ "name": "monitor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "region": {
+ "name": "region",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "start_time": {
+ "name": "start_time",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "end_time": {
+ "name": "end_time",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'active'"
+ },
+ "acknowledged_by": {
+ "name": "acknowledged_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "acknowledged_at": {
+ "name": "acknowledged_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "resolved_by": {
+ "name": "resolved_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_error": {
+ "name": "last_error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_error_type": {
+ "name": "last_error_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_count": {
+ "name": "failure_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 1
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "uptime_incidents_organization_id_organization_id_fk": {
+ "name": "uptime_incidents_organization_id_organization_id_fk",
+ "tableFrom": "uptime_incidents",
+ "tableTo": "organization",
+ "columnsFrom": [
+ "organization_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "uptime_incidents_monitor_id_uptime_monitors_id_fk": {
+ "name": "uptime_incidents_monitor_id_uptime_monitors_id_fk",
+ "tableFrom": "uptime_incidents",
+ "tableTo": "uptime_monitors",
+ "columnsFrom": [
+ "monitor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "uptime_incidents_acknowledged_by_user_id_fk": {
+ "name": "uptime_incidents_acknowledged_by_user_id_fk",
+ "tableFrom": "uptime_incidents",
+ "tableTo": "user",
+ "columnsFrom": [
+ "acknowledged_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "uptime_incidents_resolved_by_user_id_fk": {
+ "name": "uptime_incidents_resolved_by_user_id_fk",
+ "tableFrom": "uptime_incidents",
+ "tableTo": "user",
+ "columnsFrom": [
+ "resolved_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.uptime_monitor_status": {
+ "name": "uptime_monitor_status",
+ "schema": "",
+ "columns": {
+ "monitor_id": {
+ "name": "monitor_id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "last_checked_at": {
+ "name": "last_checked_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "next_check_at": {
+ "name": "next_check_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "current_status": {
+ "name": "current_status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'unknown'"
+ },
+ "consecutive_failures": {
+ "name": "consecutive_failures",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "consecutive_successes": {
+ "name": "consecutive_successes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "uptime_percentage_24h": {
+ "name": "uptime_percentage_24h",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "uptime_percentage_7d": {
+ "name": "uptime_percentage_7d",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "uptime_percentage_30d": {
+ "name": "uptime_percentage_30d",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "average_response_time_24h": {
+ "name": "average_response_time_24h",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "uptime_monitor_status_updated_at_idx": {
+ "name": "uptime_monitor_status_updated_at_idx",
+ "columns": [
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "uptime_monitor_status_monitor_id_uptime_monitors_id_fk": {
+ "name": "uptime_monitor_status_monitor_id_uptime_monitors_id_fk",
+ "tableFrom": "uptime_monitor_status",
+ "tableTo": "uptime_monitors",
+ "columnsFrom": [
+ "monitor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "uptime_monitor_status_current_status_check": {
+ "name": "uptime_monitor_status_current_status_check",
+ "value": "current_status IN ('up', 'down', 'unknown')"
+ },
+ "uptime_monitor_status_uptime_24h_check": {
+ "name": "uptime_monitor_status_uptime_24h_check",
+ "value": "uptime_percentage_24h >= 0 AND uptime_percentage_24h <= 100"
+ },
+ "uptime_monitor_status_uptime_7d_check": {
+ "name": "uptime_monitor_status_uptime_7d_check",
+ "value": "uptime_percentage_7d >= 0 AND uptime_percentage_7d <= 100"
+ },
+ "uptime_monitor_status_uptime_30d_check": {
+ "name": "uptime_monitor_status_uptime_30d_check",
+ "value": "uptime_percentage_30d >= 0 AND uptime_percentage_30d <= 100"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.uptime_monitors": {
+ "name": "uptime_monitors",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "organization_id": {
+ "name": "organization_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "monitor_type": {
+ "name": "monitor_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "http_config": {
+ "name": "http_config",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tcp_config": {
+ "name": "tcp_config",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "validation_rules": {
+ "name": "validation_rules",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "monitoring_type": {
+ "name": "monitoring_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'local'"
+ },
+ "selected_regions": {
+ "name": "selected_regions",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'[\"local\"]'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "uptime_monitors_organization_id_organization_id_fk": {
+ "name": "uptime_monitors_organization_id_organization_id_fk",
+ "tableFrom": "uptime_monitors",
+ "tableTo": "organization",
+ "columnsFrom": [
+ "organization_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "uptime_monitors_created_by_user_id_fk": {
+ "name": "uptime_monitors_created_by_user_id_fk",
+ "tableFrom": "uptime_monitors",
+ "tableTo": "user",
+ "columnsFrom": [
+ "created_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user": {
+ "name": "user",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "emailVerified": {
+ "name": "emailVerified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "createdAt": {
+ "name": "createdAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updatedAt": {
+ "name": "updatedAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'user'"
+ },
+ "displayUsername": {
+ "name": "displayUsername",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "banned": {
+ "name": "banned",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "banReason": {
+ "name": "banReason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "banExpires": {
+ "name": "banExpires",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stripeCustomerId": {
+ "name": "stripeCustomerId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "overMonthlyLimit": {
+ "name": "overMonthlyLimit",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "monthlyEventCount": {
+ "name": "monthlyEventCount",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "sendAutoEmailReports": {
+ "name": "sendAutoEmailReports",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "scheduled_tip_email_ids": {
+ "name": "scheduled_tip_email_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'[]'::jsonb"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "user_username_unique": {
+ "name": "user_username_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "username"
+ ]
+ },
+ "user_email_unique": {
+ "name": "user_email_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "email"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_aliases": {
+ "name": "user_aliases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "site_id": {
+ "name": "site_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "anonymous_id": {
+ "name": "anonymous_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_aliases_user_idx": {
+ "name": "user_aliases_user_idx",
+ "columns": [
+ {
+ "expression": "site_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_aliases_anon_idx": {
+ "name": "user_aliases_anon_idx",
+ "columns": [
+ {
+ "expression": "site_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "anonymous_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_aliases_site_id_sites_site_id_fk": {
+ "name": "user_aliases_site_id_sites_site_id_fk",
+ "tableFrom": "user_aliases",
+ "tableTo": "sites",
+ "columnsFrom": [
+ "site_id"
+ ],
+ "columnsTo": [
+ "site_id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "user_aliases_site_anon_unique": {
+ "name": "user_aliases_site_anon_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "site_id",
+ "anonymous_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_profiles": {
+ "name": "user_profiles",
+ "schema": "",
+ "columns": {
+ "site_id": {
+ "name": "site_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "traits": {
+ "name": "traits",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'{}'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_profiles_site_idx": {
+ "name": "user_profiles_site_idx",
+ "columns": [
+ {
+ "expression": "site_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_profiles_site_id_sites_site_id_fk": {
+ "name": "user_profiles_site_id_sites_site_id_fk",
+ "tableFrom": "user_profiles",
+ "tableTo": "sites",
+ "columnsFrom": [
+ "site_id"
+ ],
+ "columnsTo": [
+ "site_id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_profiles_site_id_user_id_pk": {
+ "name": "user_profiles_site_id_user_id_pk",
+ "columns": [
+ "site_id",
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.verification": {
+ "name": "verification",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expiresAt": {
+ "name": "expiresAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "createdAt": {
+ "name": "createdAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updatedAt": {
+ "name": "updatedAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.import_platform_enum": {
+ "name": "import_platform_enum",
+ "schema": "public",
+ "values": [
+ "umami",
+ "simple_analytics",
+ "plausible"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/server/drizzle/meta/_journal.json b/server/drizzle/meta/_journal.json
index 05679b82e..258ab8b2e 100644
--- a/server/drizzle/meta/_journal.json
+++ b/server/drizzle/meta/_journal.json
@@ -50,6 +50,13 @@
"when": 1779981165610,
"tag": "0006_orange_thunderbird",
"breakpoints": true
+ },
+ {
+ "idx": 7,
+ "version": "7",
+ "when": 1779981165611,
+ "tag": "0007_site_type",
+ "breakpoints": true
}
]
-}
\ No newline at end of file
+}
diff --git a/server/package.json b/server/package.json
index 75d2be589..032eb906f 100644
--- a/server/package.json
+++ b/server/package.json
@@ -24,7 +24,8 @@
"update:referrer-spam": "node src/services/tracker/botBlocking/update-referrer-spam.mjs",
"knip": "knip",
"format": "prettier --write \"src/**/*.{js,ts,json,md}\"",
- "format:check": "prettier --check \"src/**/*.{js,ts,json,md}\""
+ "format:check": "prettier --check \"src/**/*.{js,ts,json,md}\"",
+ "backfill:lite-mvs": "tsc && node dist/scripts/backfillLiteDashboardMVs.js"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.842.0",
diff --git a/server/src/api/admin/getAdminSites.ts b/server/src/api/admin/getAdminSites.ts
index a091eedc2..6aa28f3d6 100644
--- a/server/src/api/admin/getAdminSites.ts
+++ b/server/src/api/admin/getAdminSites.ts
@@ -97,10 +97,7 @@ export async function getAdminSites(request: FastifyRequest, reply: FastifyReply
}
// Get goal and funnel counts per site
- const goalCounts = await db
- .select({ siteId: goals.siteId, count: count() })
- .from(goals)
- .groupBy(goals.siteId);
+ const goalCounts = await db.select({ siteId: goals.siteId, count: count() }).from(goals).groupBy(goals.siteId);
const funnelCounts = await db
.select({ siteId: funnels.siteId, count: count() })
@@ -128,7 +125,8 @@ export async function getAdminSites(request: FastifyRequest, reply: FastifyReply
return {
siteId: site.siteId,
name: site.name,
- domain: site.domain,
+ type: site.type || "web",
+ domain: site.domain || "",
createdAt: site.createdAt,
public: site.public,
eventsLast24Hours: siteEventMap24h.get(site.siteId) || 0,
diff --git a/server/src/api/analytics/index.ts b/server/src/api/analytics/index.ts
index d2990b61e..ca8d7009a 100644
--- a/server/src/api/analytics/index.ts
+++ b/server/src/api/analytics/index.ts
@@ -44,6 +44,9 @@ export { getMetric } from "./getMetric.js";
export { getOrgEventCount } from "./getOrgEventCount.js";
export { getOverview } from "./getOverview.js";
export { getOverviewBucketed } from "./getOverviewBucketed.js";
+export { getOverviewLite } from "./lite/getOverviewLite.js";
+export { getOverviewBucketedLite } from "./lite/getOverviewBucketedLite.js";
+export { getMetricLite } from "./lite/getMetricLite.js";
export { getPageTitles } from "./getPageTitles.js";
export { getRetention } from "./getRetention.js";
export { getSession } from "./sessions/getSession.js";
diff --git a/server/src/api/analytics/lite/getMetricLite.ts b/server/src/api/analytics/lite/getMetricLite.ts
new file mode 100644
index 000000000..70e199b69
--- /dev/null
+++ b/server/src/api/analytics/lite/getMetricLite.ts
@@ -0,0 +1,203 @@
+import { FilterParams } from "@rybbit/shared";
+import { FastifyReply, FastifyRequest } from "fastify";
+import { clickhouse } from "../../../db/clickhouse/clickhouse.js";
+import { getMetric } from "../getMetric.js";
+import { processResults } from "../utils/utils.js";
+import { getLiteSessionFilter, getLiteTimeStatement, hasLiteFilters } from "./utils.js";
+
+// Lite metric supports only dimensions backed by MVs:
+// - pathname → pathname_hourly_mv_target
+// - country → country_hourly_mv_target
+// - device_type → device_type_hourly_mv_target
+// Other parameters return 400 — the simplified dashboard hides those sections.
+type LiteMetricParameter = "pathname" | "country" | "device_type";
+
+type LiteMetricItem = {
+ value: string;
+ hostname?: string;
+ count: number; // sessions
+ percentage: number;
+ pageviews: number;
+ pageviews_percentage: number;
+ // count() OVER () — total distinct values across all pages, computed before
+ // LIMIT/OFFSET so it's stable per page. Stripped from the response items.
+ total_count?: number;
+};
+
+export async function getMetricLite(
+ req: FastifyRequest<{
+ Params: { siteId: string };
+ Querystring: FilterParams<{ parameter: LiteMetricParameter; limit?: number; page?: number }>;
+ }>,
+ res: FastifyReply
+) {
+ const site = Number(req.params.siteId);
+ const { parameter } = req.query;
+ const limit = Math.min(Number(req.query.limit) || 250, 500);
+ const page = Math.max(Number(req.query.page) || 1, 1);
+ const offsetStatement = page > 1 ? `OFFSET ${(page - 1) * limit}` : "";
+ const filtersPresent = hasLiteFilters(req.query.filters);
+
+ // Pull totalCount off the window column and drop it from the returned rows so
+ // items match the standard /metric shape.
+ const sendMetric = (data: LiteMetricItem[]) => {
+ const totalCount = data.length > 0 ? (data[0].total_count ?? data.length) : 0;
+ const items = data.map(({ total_count, ...rest }) => rest);
+ return res.send({ data: { data: items, totalCount } });
+ };
+
+ // Filtered country/device_type lists can be served from sessions_mv_target
+ // (it carries both columns per session), as long as every active filter
+ // targets a session column. pathname isn't on the session rollup — and no
+ // dimensioned MV pairs pathname with another dimension — so any filtered
+ // pathname list falls back to the raw-events query.
+ if (filtersPresent) {
+ const filter = getLiteSessionFilter(req.query.filters);
+ const sessionFastPath = filter.supported && (parameter === "country" || parameter === "device_type");
+ if (!sessionFastPath) {
+ return getMetric(req as unknown as Parameters<typeof getMetric>[0], res);
+ }
+
+ const sessionsTime = getLiteTimeStatement(req.query, "start_time");
+ const nonEmpty = parameter === "device_type" ? `AND ${parameter} <> ''` : "";
+ const query = `
+ SELECT
+ value,
+ pageviews,
+ count,
+ round(count * 100.0 / sum(count) OVER (), 2) AS percentage,
+ round(pageviews * 100.0 / sum(pageviews) OVER (), 2) AS pageviews_percentage,
+ count() OVER () AS total_count
+ FROM (
+ SELECT
+ ${parameter} AS value,
+ sum(session_pageviews) AS pageviews,
+ count() AS count
+ FROM (
+ SELECT
+ session_id,
+ any(${parameter}) AS ${parameter},
+ sum(pageviews) AS session_pageviews
+ FROM sessions_mv_target
+ WHERE site_id = {siteId:Int32}
+ ${sessionsTime}
+ ${nonEmpty}
+ ${filter.sql}
+ GROUP BY session_id
+ )
+ GROUP BY ${parameter}
+ )
+ ORDER BY count DESC
+ LIMIT ${limit}
+ ${offsetStatement}
+ `;
+
+ try {
+ const result = await clickhouse.query({
+ query,
+ format: "JSONEachRow",
+ query_params: { siteId: site },
+ });
+ const data = await processResults<LiteMetricItem>(result);
+ return sendMetric(data);
+ } catch (error) {
+ console.error("Error fetching lite metric:", error);
+ return res.status(500).send({ error: "Failed to fetch metric" });
+ }
+ }
+
+ const timeStatement = getLiteTimeStatement(req.query, "event_hour");
+
+ // Percentages are computed in an outer pass so the window function
+ // operates on already-grouped rows. `sum(sum(...)) OVER ()` is illegal
+ // in ClickHouse — aggregates can't nest.
+ let query: string;
+ if (parameter === "pathname") {
+ query = `
+ SELECT
+ value,
+ hostname,
+ pageviews,
+ count,
+ round(count * 100.0 / sum(count) OVER (), 2) AS percentage,
+ round(pageviews * 100.0 / sum(pageviews) OVER (), 2) AS pageviews_percentage,
+ count() OVER () AS total_count
+ FROM (
+ SELECT
+ pathname AS value,
+ any(hostname) AS hostname,
+ sum(pageviews) AS pageviews,
+ uniqMerge(sessions) AS count
+ FROM pathname_hourly_mv_target
+ WHERE site_id = {siteId:Int32}
+ ${timeStatement}
+ GROUP BY pathname
+ )
+ ORDER BY count DESC
+ LIMIT ${limit}
+ ${offsetStatement}
+ `;
+ } else if (parameter === "country") {
+ query = `
+ SELECT
+ value,
+ pageviews,
+ count,
+ round(count * 100.0 / sum(count) OVER (), 2) AS percentage,
+ round(pageviews * 100.0 / sum(pageviews) OVER (), 2) AS pageviews_percentage,
+ count() OVER () AS total_count
+ FROM (
+ SELECT
+ country AS value,
+ sum(pageviews) AS pageviews,
+ uniqMerge(sessions) AS count
+ FROM country_hourly_mv_target
+ WHERE site_id = {siteId:Int32}
+ ${timeStatement}
+ GROUP BY country
+ )
+ ORDER BY count DESC
+ LIMIT ${limit}
+ ${offsetStatement}
+ `;
+ } else if (parameter === "device_type") {
+ query = `
+ SELECT
+ value,
+ pageviews,
+ count,
+ round(count * 100.0 / sum(count) OVER (), 2) AS percentage,
+ round(pageviews * 100.0 / sum(pageviews) OVER (), 2) AS pageviews_percentage,
+ count() OVER () AS total_count
+ FROM (
+ SELECT
+ device_type AS value,
+ sum(pageviews) AS pageviews,
+ uniqMerge(sessions) AS count
+ FROM device_type_hourly_mv_target
+ WHERE site_id = {siteId:Int32}
+ AND device_type <> ''
+ ${timeStatement}
+ GROUP BY device_type
+ )
+ ORDER BY count DESC
+ LIMIT ${limit}
+ ${offsetStatement}
+ `;
+ } else {
+ return res.status(400).send({ error: "Lite mode does not support this parameter" });
+ }
+
+ try {
+ const result = await clickhouse.query({
+ query,
+ format: "JSONEachRow",
+ query_params: { siteId: site },
+ });
+ const data = await processResults<LiteMetricItem>(result);
+ return sendMetric(data);
+ } catch (error) {
+ console.error("Error fetching lite metric:", error);
+ return res.status(500).send({ error: "Failed to fetch metric" });
+ }
+}
diff --git a/server/src/api/analytics/lite/getOverviewBucketedLite.ts b/server/src/api/analytics/lite/getOverviewBucketedLite.ts
new file mode 100644
index 000000000..30bd8713f
--- /dev/null
+++ b/server/src/api/analytics/lite/getOverviewBucketedLite.ts
@@ -0,0 +1,235 @@
+import { FilterParams } from "@rybbit/shared";
+import { FastifyReply, FastifyRequest } from "fastify";
+import SqlString from "sqlstring";
+import { clickhouse } from "../../../db/clickhouse/clickhouse.js";
+import { getOverviewBucketed } from "../getOverviewBucketed.js";
+import { TimeBucket } from "../types.js";
+import { TimeBucketToFn, processResults } from "../utils/utils.js";
+import { getLiteFillClause, getLiteSessionFilter, getLiteTimeStatement, hasLiteFilters, liteBucket } from "./utils.js";
+
+type GetOverviewBucketedLiteResponse = {
+ time: string;
+ pageviews: number;
+ sessions: number;
+ pages_per_session: number;
+ bounce_rate: number;
+ session_duration: number;
+ users: number;
+}[];
+
+// Hour-bucketed charts use the streaming MV JOIN: pageviews/users are bucketed
+// by EVENT timestamp (when the pageview happened) which matches the standard
+// endpoint's semantics.
+//
+// Day/week/month charts read the refreshable session_hourly_mv directly. At
+// day+ granularity the difference between event-time and session-start-time
+// bucketing is negligible (sessions rarely cross day boundaries), and we get
+// all 6 metrics from a single small table.
+function buildHourBucketQuery(args: {
+ fn: string;
+ tz: string;
+ overviewTime: string;
+ sessionsTime: string;
+ fill: string;
+}) {
+ const { fn, tz, overviewTime, sessionsTime, fill } = args;
+ return `
+ SELECT
+ coalesce(p.time, s.time) AS time,
+ coalesce(p.pageviews, 0) AS pageviews,
+ coalesce(p.users, 0) AS users,
+ coalesce(s.sessions, 0) AS sessions,
+ coalesce(s.pages_per_session, 0) AS pages_per_session,
+ coalesce(s.bounce_rate, 0) AS bounce_rate,
+ coalesce(s.session_duration, 0) AS session_duration
+ FROM (
+ SELECT
+ toDateTime(${fn}(toTimeZone(event_hour, ${tz}))) AS time,
+ sum(pageviews) AS pageviews,
+ uniqMerge(users) AS users
+ FROM overview_hourly_mv_target
+ WHERE site_id = {siteId:Int32}
+ ${overviewTime}
+ GROUP BY time
+ ORDER BY time ${fill}
+ ) p
+ FULL JOIN (
+ SELECT
+ toDateTime(${fn}(toTimeZone(session_start, ${tz}))) AS time,
+ count() AS sessions,
+ avg(session_pageviews) AS pages_per_session,
+ countIf(session_pageviews = 1) / count() * 100 AS bounce_rate,
+ avg(session_end - session_start) AS session_duration
+ FROM (
+ SELECT
+ session_id,
+ sum(pageviews) AS session_pageviews,
+ min(start_time) AS session_start,
+ max(end_time) AS session_end
+ FROM sessions_mv_target
+ WHERE site_id = {siteId:Int32}
+ ${sessionsTime}
+ GROUP BY session_id
+ )
+ GROUP BY time
+ ORDER BY time ${fill}
+ ) s USING time
+ ORDER BY time
+ `;
+}
+
+function buildDayBucketQuery(args: {
+ fn: string;
+ tz: string;
+ sessionTime: string;
+ fill: string;
+}) {
+ const { fn, tz, sessionTime, fill } = args;
+ // Aggregate in the inner GROUP BY, then compose ratios in the outer SELECT.
+ // Aliasing `sum(sessions) AS sessions` would shadow the column inside the
+ // div-by-zero guard and trigger ILLEGAL_AGGREGATION.
+ return `
+ SELECT
+ time,
+ sessions,
+ pageviews,
+ users,
+ if(sessions > 0, pageviews / sessions, 0) AS pages_per_session,
+ if(sessions > 0, bounced_sessions * 100.0 / sessions, 0) AS bounce_rate,
+ if(sessions > 0, total_session_duration_seconds / sessions, 0) AS session_duration
+ FROM (
+ SELECT
+ toDateTime(${fn}(toTimeZone(session_hour, ${tz}))) AS time,
+ sum(sessions) AS sessions,
+ sum(pageviews) AS pageviews,
+ uniqMerge(users) AS users,
+ sum(bounced_sessions) AS bounced_sessions,
+ sum(total_session_duration_seconds) AS total_session_duration_seconds
+ FROM session_hourly_mv_target
+ WHERE site_id = {siteId:Int32}
+ ${sessionTime}
+ GROUP BY time
+ ORDER BY time ${fill}
+ )
+ ORDER BY time
+ `;
+}
+
+// Filtered charts read sessions_mv_target (one row per session) and bucket by
+// session start. pageviews/users come from the same rollup rather than the
+// dimensionless overview_hourly_mv, so any session-column filter stays on the
+// MVs. Bucketing by session-start instead of event-time is the same negligible
+// approximation the day-bucket path already makes.
+function buildSessionMvFilteredQuery(args: {
+ fn: string;
+ tz: string;
+ sessionsTime: string;
+ fill: string;
+ filterSql: string;
+}) {
+ const { fn, tz, sessionsTime, fill, filterSql } = args;
+ return `
+ SELECT
+ time,
+ sessions,
+ pageviews,
+ users,
+ if(sessions > 0, pageviews / sessions, 0) AS pages_per_session,
+ if(sessions > 0, bounced_sessions * 100.0 / sessions, 0) AS bounce_rate,
+ if(sessions > 0, total_session_duration_seconds / sessions, 0) AS session_duration
+ FROM (
+ SELECT
+ toDateTime(${fn}(toTimeZone(session_start, ${tz}))) AS time,
+ count() AS sessions,
+ sum(session_pageviews) AS pageviews,
+ uniqExact(user_id) AS users,
+ countIf(session_pageviews = 1) AS bounced_sessions,
+ sum(toUInt64(session_end - session_start)) AS total_session_duration_seconds
+ FROM (
+ SELECT
+ session_id,
+ any(user_id) AS user_id,
+ sum(pageviews) AS session_pageviews,
+ min(start_time) AS session_start,
+ max(end_time) AS session_end
+ FROM sessions_mv_target
+ WHERE site_id = {siteId:Int32}
+ ${sessionsTime}
+ ${filterSql}
+ GROUP BY session_id
+ )
+ GROUP BY time
+ ORDER BY time ${fill}
+ )
+ ORDER BY time
+ `;
+}
+
+export async function getOverviewBucketedLite(
+ req: FastifyRequest<{
+ Params: { siteId: string };
+ Querystring: FilterParams<{ bucket: TimeBucket }>;
+ }>,
+ res: FastifyReply
+) {
+ const site = Number(req.params.siteId);
+ const bucket = liteBucket(req.query.bucket);
+ const fn = TimeBucketToFn[bucket];
+ const tz = SqlString.escape(req.query.time_zone || "UTC");
+
+ const isAllTime =
+ !req.query.start_date &&
+ !req.query.end_date &&
+ req.query.past_minutes_start === undefined &&
+ req.query.past_minutes_end === undefined;
+ const fill = isAllTime ? "" : getLiteFillClause(req.query, bucket);
+
+ const filtersPresent = hasLiteFilters(req.query.filters);
+
+ let query: string;
+ if (filtersPresent) {
+ // Session-column filters stay on sessions_mv_target; anything else falls
+ // back to the raw-events query.
+ const filter = getLiteSessionFilter(req.query.filters);
+ if (!filter.supported) {
+ return getOverviewBucketed(req, res);
+ }
+ query = buildSessionMvFilteredQuery({
+ fn,
+ tz,
+ sessionsTime: getLiteTimeStatement(req.query, "start_time"),
+ fill,
+ filterSql: filter.sql,
+ });
+ } else {
+ const useDayBucket = bucket === "day" || bucket === "week" || bucket === "month" || bucket === "year";
+
+ query = useDayBucket
+ ? buildDayBucketQuery({
+ fn,
+ tz,
+ sessionTime: getLiteTimeStatement(req.query, "session_hour"),
+ fill,
+ })
+ : buildHourBucketQuery({
+ fn,
+ tz,
+ overviewTime: getLiteTimeStatement(req.query, "event_hour"),
+ sessionsTime: getLiteTimeStatement(req.query, "start_time"),
+ fill,
+ });
+ }
+
+ try {
+ const result = await clickhouse.query({
+ query,
+ format: "JSONEachRow",
+ query_params: { siteId: site },
+ });
+ const data = await processResults<GetOverviewBucketedLiteResponse[number]>(result);
+ return res.send({ data });
+ } catch (error) {
+ console.error("Error fetching lite bucketed overview:", error);
+ return res.status(500).send({ error: "Failed to fetch overview" });
+ }
+}
diff --git a/server/src/api/analytics/lite/getOverviewLite.ts b/server/src/api/analytics/lite/getOverviewLite.ts
new file mode 100644
index 000000000..51eaa7a0a
--- /dev/null
+++ b/server/src/api/analytics/lite/getOverviewLite.ts
@@ -0,0 +1,114 @@
+import { FilterParams } from "@rybbit/shared";
+import { FastifyReply, FastifyRequest } from "fastify";
+import { clickhouse } from "../../../db/clickhouse/clickhouse.js";
+import { getOverview } from "../getOverview.js";
+import { processResults } from "../utils/utils.js";
+import { getLiteSessionFilter, getLiteTimeStatement, hasLiteFilters } from "./utils.js";
+
+type GetOverviewLiteResponse = {
+ sessions: number;
+ pageviews: number;
+ users: number;
+ pages_per_session: number;
+ bounce_rate: number;
+ session_duration: number;
+};
+
+export async function getOverviewLite(
+ req: FastifyRequest<{
+ Params: { siteId: string };
+ Querystring: FilterParams;
+ }>,
+ res: FastifyReply
+) {
+ const site = Number(req.params.siteId);
+ const filtersPresent = hasLiteFilters(req.query.filters);
+
+ // Filtered queries read sessions_mv_target (one row per session) so any
+ // session-column filter — country, device_type, etc. — stays on the MVs.
+ // Filters that touch columns the session rollup doesn't carry (pathname,
+ // utm, …) fall back to the raw-events query.
+ let query: string;
+ if (filtersPresent) {
+ const filter = getLiteSessionFilter(req.query.filters);
+ if (!filter.supported) {
+ return getOverview(req, res);
+ }
+
+ const sessionsTime = getLiteTimeStatement(req.query, "start_time");
+ query = `
+ SELECT
+ sessions,
+ pageviews,
+ users,
+ if(sessions > 0, pageviews / sessions, 0) AS pages_per_session,
+ if(sessions > 0, bounced_sessions * 100.0 / sessions, 0) AS bounce_rate,
+ if(sessions > 0, total_session_duration_seconds / sessions, 0) AS session_duration
+ FROM (
+ SELECT
+ count() AS sessions,
+ sum(session_pageviews) AS pageviews,
+ uniqExact(user_id) AS users,
+ countIf(session_pageviews = 1) AS bounced_sessions,
+ sum(toUInt64(session_end - session_start)) AS total_session_duration_seconds
+ FROM (
+ SELECT
+ session_id,
+ any(user_id) AS user_id,
+ sum(pageviews) AS session_pageviews,
+ min(start_time) AS session_start,
+ max(end_time) AS session_end
+ FROM sessions_mv_target
+ WHERE site_id = {siteId:Int32}
+ ${sessionsTime}
+ ${filter.sql}
+ GROUP BY session_id
+ )
+ )
+ `;
+ } else {
+ const timeStatement = getLiteTimeStatement(req.query, "session_hour");
+
+ // Single read of the refreshable session_hourly_mv_target — ~720 rows/month
+ // per site instead of millions of session rows. All 6 metrics derive from
+ // pre-computed sums and one HLL state.
+ //
+ // Aggregations run in the inner subquery; divisions compose plain values in
+ // the outer SELECT. Don't alias `sum(sessions) AS sessions` at this level —
+ // ClickHouse will resolve the column name to the aggregate and reject as
+ // nested aggregation.
+ query = `
+ SELECT
+ sessions,
+ pageviews,
+ users,
+ if(sessions > 0, pageviews / sessions, 0) AS pages_per_session,
+ if(sessions > 0, bounced_sessions * 100.0 / sessions, 0) AS bounce_rate,
+ if(sessions > 0, total_session_duration_seconds / sessions, 0) AS session_duration
+ FROM (
+ SELECT
+ sum(sessions) AS sessions,
+ sum(pageviews) AS pageviews,
+ uniqMerge(users) AS users,
+ sum(bounced_sessions) AS bounced_sessions,
+ sum(total_session_duration_seconds) AS total_session_duration_seconds
+ FROM session_hourly_mv_target
+ WHERE site_id = {siteId:Int32}
+ ${timeStatement}
+ )
+ `;
+ }
+
+ try {
+ const result = await clickhouse.query({
+ query,
+ format: "JSONEachRow",
+ query_params: { siteId: site },
+ });
+ const data = await processResults<GetOverviewLiteResponse>(result);
+ return res.send({ data: data[0] });
+ } catch (error) {
+ console.error("Error fetching lite overview:", error);
+ return res.status(500).send({ error: "Failed to fetch overview" });
+ }
+}
diff --git a/server/src/api/analytics/lite/utils.ts b/server/src/api/analytics/lite/utils.ts
new file mode 100644
index 000000000..c481196ce
--- /dev/null
+++ b/server/src/api/analytics/lite/utils.ts
@@ -0,0 +1,201 @@
+import { FilterParams } from "@rybbit/shared";
+import SqlString from "sqlstring";
+import { TimeBucket } from "../types.js";
+import { TimeBucketToFn, bucketIntervalMap } from "../utils/utils.js";
+import { validateFilters, validateTimeStatementParams } from "../utils/query-validation.js";
+
+// Lite endpoints back the simplified high-traffic dashboard. They read from
+// hourly materialized views (overview_hourly_mv, sessions_mv, pathname_hourly_mv,
+// country_hourly_mv, device_type_hourly_mv) instead of raw events. Sub-hour
+// buckets are promoted to hour because the MVs are hour-grained.
+//
+// Filters are served three ways, fastest first:
+// 1. No filter → the per-dimension hourly rollups (smallest reads).
+// 2. Session-column filter → sessions_mv_target, one row per session. Every
+// dimension the session rollup carries (country, device_type, browser, …)
+// can be filtered here without touching raw events.
+// 3. Anything else → fall back to the raw `events` query (standard
+// endpoints). pathname/page_title/utm/etc. aren't on the session rollup.
+
+// True when the request carries at least one valid filter.
+export function hasLiteFilters(filters: string | undefined): boolean {
+ if (!filters) return false;
+ return validateFilters(filters).length > 0;
+}
+
+// Dimension columns carried by sessions_mv_target, keyed by filter parameter.
+// A filter on any of these can be answered from the session rollup; a filter on
+// anything else forces the raw-events fallback.
+//
+// Only session-INVARIANT attributes belong here. sessions_mv writes one partial
+// row per insert block per session and the read queries re-aggregate by
+// session_id, so a WHERE filter on these columns is correct only when every
+// partial row of a session shares the value (device, geo, hostname — true for
+// the whole session). Entry/acquisition attributes (entry_page, referrer,
+// channel) are first-event values that differ across a session's events, so a
+// per-partial-row filter would match some rows and drop others, undercounting.
+// Those deliberately fall back to the raw-events query, which derives them with
+// the same argMin/first-value semantics as the standard endpoints.
+const LITE_SESSION_FILTER_COLUMNS: Record<string, string> = {
+ country: "country",
+ region: "region",
+ device_type: "device_type",
+ browser: "browser",
+ operating_system: "operating_system",
+ hostname: "hostname",
+};
+
+const LITE_FILTER_OPERATORS: Record<string, string> = {
+ equals: "=",
+ not_equals: "!=",
+ contains: "LIKE",
+ not_contains: "NOT LIKE",
+ starts_with: "LIKE",
+ ends_with: "LIKE",
+};
+
+function wrapLiteLikeValue(type: string, value: string | number): string {
+ const v = String(value);
+ if (type === "contains" || type === "not_contains") return `%${v}%`;
+ if (type === "starts_with") return `${v}%`;
+ if (type === "ends_with") return `%${v}`;
+ return v;
+}
+
+// Build a WHERE-clause fragment (prefixed " AND ") against sessions_mv_target
+// columns. Returns `supported: false` when any filter targets a column or type
+// the session rollup can't serve, signalling the caller to fall back to events.
+export function getLiteSessionFilter(filters: string | undefined): { supported: boolean; sql: string } {
+ if (!filters) return { supported: true, sql: "" };
+
+ const filtersArray = validateFilters(filters);
+ if (filtersArray.length === 0) return { supported: true, sql: "" };
+
+ const conditions: string[] = [];
+
+ for (const filter of filtersArray) {
+ const column = LITE_SESSION_FILTER_COLUMNS[filter.parameter];
+ if (!column) return { supported: false, sql: "" };
+
+ if (filter.type === "is_null") {
+ conditions.push(`(${column} IS NULL OR ${column} = '')`);
+ continue;
+ }
+ if (filter.type === "is_not_null") {
+ conditions.push(`(${column} IS NOT NULL AND ${column} != '')`);
+ continue;
+ }
+
+ const op = LITE_FILTER_OPERATORS[filter.type];
+ if (!op || filter.value.length === 0) return { supported: false, sql: "" };
+
+ const parts = filter.value.map(
+ value => `${column} ${op} ${SqlString.escape(wrapLiteLikeValue(filter.type, value))}`
+ );
+ conditions.push(parts.length === 1 ? parts[0] : `(${parts.join(" OR ")})`);
+ }
+
+ return { supported: true, sql: conditions.length ? `AND ${conditions.join(" AND ")}` : "" };
+}
+
+export type LiteTimeRange = {
+ startStatement: string;
+ endStatement: string;
+ whereClause: string;
+};
+
+// Build a WHERE-clause fragment that filters an MV's hour-bucket column.
+// The `column` is whichever hour-truncated DateTime column the MV exposes
+// (overview_hourly_mv uses `event_hour`; sessions_mv uses `start_time`).
+export function getLiteTimeStatement(
+ params: Pick<FilterParams, "start_date" | "end_date" | "time_zone" | "past_minutes_start" | "past_minutes_end">,
+ column: string
+): string {
+ const { start_date, end_date, time_zone, past_minutes_start, past_minutes_end } = params;
+
+ const pastMinutesRange =
+ past_minutes_start !== undefined && past_minutes_end !== undefined
+ ? { start: Number(past_minutes_start), end: Number(past_minutes_end) }
+ : undefined;
+
+ const date = start_date && end_date && time_zone ? { start_date, end_date, time_zone } : undefined;
+
+ const sanitized = validateTimeStatementParams({ date, pastMinutesRange });
+
+ if (sanitized.date) {
+ const { start_date, end_date, time_zone } = sanitized.date;
+ if (!start_date && !end_date) return "";
+
+ return `AND ${column} >= toTimeZone(
+ toStartOfDay(toDateTime(${SqlString.escape(start_date)}, ${SqlString.escape(time_zone)})),
+ 'UTC'
+ )
+ AND ${column} < if(
+ toDate(${SqlString.escape(end_date)}) = toDate(now(), ${SqlString.escape(time_zone)}),
+ toTimeZone(now(), 'UTC'),
+ toTimeZone(
+ toStartOfDay(toDateTime(${SqlString.escape(end_date)}, ${SqlString.escape(time_zone)})) + INTERVAL 1 DAY,
+ 'UTC'
+ )
+ )`;
+ }
+
+ if (sanitized.pastMinutesRange) {
+ const { start, end } = sanitized.pastMinutesRange;
+ const now = new Date();
+ const startTimestamp = new Date(now.getTime() - start * 60 * 1000);
+ const endTimestamp = new Date(now.getTime() - end * 60 * 1000);
+ const startIso = startTimestamp.toISOString().slice(0, 19).replace("T", " ");
+ const endIso = endTimestamp.toISOString().slice(0, 19).replace("T", " ");
+
+ return `AND ${column} > toDateTime(${SqlString.escape(startIso)}) AND ${column} <= toDateTime(${SqlString.escape(endIso)})`;
+ }
+
+ return "";
+}
+
+// MVs are hour-bucketed, so anything below `hour` gets promoted.
+export function liteBucket(bucket: TimeBucket | undefined): TimeBucket {
+ if (!bucket) return "hour";
+ if (bucket === "minute" || bucket === "five_minutes" || bucket === "ten_minutes" || bucket === "fifteen_minutes") {
+ return "hour";
+ }
+ return bucket;
+}
+
+export function getLiteFillClause(
+ params: FilterParams,
+ bucket: TimeBucket
+): string {
+ const { start_date, end_date, time_zone, past_minutes_start, past_minutes_end } = params;
+ const fn = TimeBucketToFn[bucket];
+ const interval = bucketIntervalMap[bucket];
+
+ if (start_date && end_date && time_zone) {
+ return `WITH FILL FROM toTimeZone(
+ toDateTime(${fn}(toDateTime(${SqlString.escape(start_date)}, ${SqlString.escape(time_zone)}))),
+ 'UTC'
+ )
+ TO if(
+ toDate(${SqlString.escape(end_date)}) = toDate(now(), ${SqlString.escape(time_zone)}),
+ toTimeZone(now(), 'UTC'),
+ toTimeZone(
+ toDateTime(${fn}(toDateTime(${SqlString.escape(end_date)}, ${SqlString.escape(time_zone)}))) + INTERVAL 1 DAY,
+ 'UTC'
+ )
+ ) STEP INTERVAL ${interval}`;
+ }
+
+ if (past_minutes_start !== undefined && past_minutes_end !== undefined) {
+ const now = new Date();
+ const startTs = new Date(now.getTime() - Number(past_minutes_start) * 60 * 1000);
+ const endTs = new Date(now.getTime() - Number(past_minutes_end) * 60 * 1000);
+ const startIso = startTs.toISOString().slice(0, 19).replace("T", " ");
+ const endIso = endTs.toISOString().slice(0, 19).replace("T", " ");
+ return `WITH FILL FROM ${fn}(toDateTime(${SqlString.escape(startIso)}))
+ TO ${fn}(toDateTime(${SqlString.escape(endIso)})) + INTERVAL ${interval}
+ STEP INTERVAL ${interval}`;
+ }
+
+ return "";
+}
diff --git a/server/src/api/getConfig.ts b/server/src/api/getConfig.ts
index 3f5e8377b..b5dcaa041 100644
--- a/server/src/api/getConfig.ts
+++ b/server/src/api/getConfig.ts
@@ -1,6 +1,6 @@
import { FastifyRequest, FastifyReply } from "fastify";
import { createRequire } from "module";
-import { DISABLE_SIGNUP, MAPBOX_TOKEN } from "../lib/const.js";
+import { DISABLE_SIGNUP, LITE_DASHBOARD, MAPBOX_TOKEN } from "../lib/const.js";
const require = createRequire(import.meta.url);
const { version } = require("../../package.json");
@@ -9,6 +9,7 @@ export async function getConfig(_: FastifyRequest, reply: FastifyReply) {
return reply.send({
disableSignup: DISABLE_SIGNUP,
mapboxToken: MAPBOX_TOKEN,
+ liteDashboard: LITE_DASHBOARD,
});
}
diff --git a/server/src/api/sites/addSite.ts b/server/src/api/sites/addSite.ts
index d126bfbe0..4e6bfda00 100644
--- a/server/src/api/sites/addSite.ts
+++ b/server/src/api/sites/addSite.ts
@@ -14,6 +14,7 @@ export async function addSite(
Body: {
domain: string;
name: string;
+ type?: "web" | "mobile" | null;
public?: boolean;
saltUserIds?: boolean;
blockBots?: boolean;
@@ -39,6 +40,7 @@ export async function addSite(
const {
domain,
name,
+ type,
public: isPublic,
saltUserIds,
blockBots,
@@ -58,16 +60,29 @@ export async function addSite(
tags,
} = request.body;
+ const siteType = type === "mobile" ? "mobile" : "web";
+
// Strip protocol and trailing slash before validation
const cleanedDomain = domain.replace(/^https?:\/\//, "").replace(/\/+$/, "");
- // Validate domain format using regex
+ // Validate domain/app identifier format using regex
const domainRegex = /^(?:[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?\.)+\p{L}{2,}$/u;
- if (!domainRegex.test(cleanedDomain)) {
+ const appIdentifierRegex = /^[A-Za-z0-9][A-Za-z0-9._-]{0,252}$/;
+ if (siteType === "web" && !domainRegex.test(cleanedDomain)) {
return reply.status(400).send({
error: "Invalid domain format. Must be a valid domain like example.com or sub.example.com",
});
}
+ if (siteType === "mobile" && !appIdentifierRegex.test(cleanedDomain)) {
+ return reply.status(400).send({
+ error: "Invalid app identifier. Use a bundle/package identifier like com.example.app",
+ });
+ }
+ if (siteType === "mobile" && (sessionReplay || webVitals)) {
+ return reply.status(400).send({
+ error: "Session replay and Web Vitals are only available for web sites",
+ });
+ }
try {
const userId = request.user?.id;
@@ -111,6 +126,7 @@ export async function addSite(
.insert(sites)
.values({
id,
+ type: siteType === "web" ? null : siteType,
domain: cleanedDomain,
name,
createdBy: userId,
@@ -120,8 +136,8 @@ export async function addSite(
blockBots: blockBots === undefined ? true : blockBots,
...(excludedIPs !== undefined && { excludedIPs }),
...(excludedCountries !== undefined && { excludedCountries }),
- ...(sessionReplay !== undefined && { sessionReplay }),
- ...(webVitals !== undefined && { webVitals }),
+ ...(sessionReplay !== undefined && { sessionReplay: siteType === "mobile" ? false : sessionReplay }),
+ ...(webVitals !== undefined && { webVitals: siteType === "mobile" ? false : webVitals }),
...(trackErrors !== undefined && { trackErrors }),
...(trackOutbound !== undefined && { trackOutbound }),
...(trackUrlParams !== undefined && { trackUrlParams }),
diff --git a/server/src/api/sites/getSite.ts b/server/src/api/sites/getSite.ts
index a5cf425e0..7231c793f 100644
--- a/server/src/api/sites/getSite.ts
+++ b/server/src/api/sites/getSite.ts
@@ -30,7 +30,8 @@ export async function getSite(request: FastifyRequest<GetSiteParams>, reply: Fas
id: site.id,
siteId: site.siteId,
name: site.name,
- domain: site.domain,
+ type: site.type || "web",
+ domain: site.domain || "",
createdAt: site.createdAt,
updatedAt: site.updatedAt,
createdBy: site.createdBy,
diff --git a/server/src/api/sites/getSitesFromOrg.ts b/server/src/api/sites/getSitesFromOrg.ts
index 932088538..8bb81b054 100644
--- a/server/src/api/sites/getSitesFromOrg.ts
+++ b/server/src/api/sites/getSitesFromOrg.ts
@@ -2,7 +2,15 @@ import { eq, and, inArray } from "drizzle-orm";
import { FastifyRequest, FastifyReply } from "fastify";
import { clickhouse } from "../../db/clickhouse/clickhouse.js";
import { db } from "../../db/postgres/postgres.js";
-import { sites, member, organization, memberSiteAccess, team, teamMember, teamSiteAccess } from "../../db/postgres/schema.js";
+import {
+ sites,
+ member,
+ organization,
+ memberSiteAccess,
+ team,
+ teamMember,
+ teamSiteAccess,
+} from "../../db/postgres/schema.js";
import { IS_CLOUD, DEFAULT_EVENT_LIMIT } from "../../lib/const.js";
import { getUserIdFromRequest } from "../../lib/auth-utils.js";
import { processResults } from "../analytics/utils/utils.js";
@@ -26,10 +34,10 @@ export async function getSitesFromOrg(
const [memberCheck, allSitesData, orgInfo] = await Promise.all([
userId
? db
- .select()
- .from(member)
- .where(and(eq(member.organizationId, organizationId), eq(member.userId, userId)))
- .limit(1)
+ .select()
+ .from(member)
+ .where(and(eq(member.organizationId, organizationId), eq(member.userId, userId)))
+ .limit(1)
: Promise.resolve([]),
db.select().from(sites).where(eq(sites.organizationId, organizationId)),
db.select().from(organization).where(eq(organization.id, organizationId)).limit(1),
@@ -84,9 +92,7 @@ export async function getSitesFromOrg(
}
// Keep sites that are NOT team-gated OR are in the user's teams
- sitesData = sitesData.filter(
- site => !teamGatedSiteIds.has(site.siteId) || userTeamSiteIds.has(site.siteId)
- );
+ sitesData = sitesData.filter(site => !teamGatedSiteIds.has(site.siteId) || userTeamSiteIds.has(site.siteId));
}
}
@@ -154,6 +160,8 @@ export async function getSitesFromOrg(
// Enhance sites data with session counts and subscription info
const enhancedSitesData = sitesData.map(site => ({
...site,
+ type: site.type || "web",
+ domain: site.domain || "",
sessionsLast24Hours: sessionCountMap.get(site.siteId) || 0,
isOwner: memberRecord?.role !== "member",
teams: siteTeamMap.get(site.siteId) || [],
diff --git a/server/src/api/sites/getTrackingConfig.ts b/server/src/api/sites/getTrackingConfig.ts
index 2a8332212..13d144661 100644
--- a/server/src/api/sites/getTrackingConfig.ts
+++ b/server/src/api/sites/getTrackingConfig.ts
@@ -13,8 +13,9 @@ export async function getTrackingConfig(request: FastifyRequest<{ Params: { site
// Return tracking configuration
// This endpoint is public since the analytics script needs to fetch it
return reply.send({
- sessionReplay: config.sessionReplay || false,
- webVitals: config.webVitals || false,
+ type: config.type,
+ sessionReplay: config.type === "mobile" ? false : config.sessionReplay || false,
+ webVitals: config.type === "mobile" ? false : config.webVitals || false,
trackErrors: config.trackErrors || false,
trackOutbound: config.trackOutbound ?? true,
trackUrlParams: config.trackUrlParams ?? true,
diff --git a/server/src/api/sites/updateSiteConfig.ts b/server/src/api/sites/updateSiteConfig.ts
index 3cd165fec..ca303c79c 100644
--- a/server/src/api/sites/updateSiteConfig.ts
+++ b/server/src/api/sites/updateSiteConfig.ts
@@ -10,17 +10,12 @@ import { validateIPPattern } from "../../lib/ipUtils.js";
const updateSiteConfigSchema = z.object({
// Site settings
name: z.string().min(1).max(255).optional(),
+ type: z.enum(["web", "mobile"]).nullable().optional(),
public: z.boolean().optional(),
embedEnabled: z.boolean().optional(),
saltUserIds: z.boolean().optional(),
blockBots: z.boolean().optional(),
- domain: z
- .string()
- .regex(
- /^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,
- "Invalid domain format. Must be a valid domain like example.com or sub.example.com"
- )
- .optional(),
+ domain: z.string().min(1).max(253).optional(),
excludedIPs: z.array(z.string().trim().min(1)).max(100).optional(),
excludedCountries: z
.array(
@@ -87,6 +82,35 @@ export async function updateSiteConfig(
return reply.status(404).send({ error: "Site not found" });
}
+ const nextSiteType = updateData.type === undefined ? site.type || "web" : updateData.type || "web";
+
+ const nextDomain = updateData.domain ?? site.domain;
+ const cleanedDomain = nextDomain.replace(/^https?:\/\//, "").replace(/\/+$/, "");
+
+ if (updateData.domain !== undefined || updateData.type !== undefined) {
+ const domainRegex = /^(?:[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?\.)+\p{L}{2,}$/u;
+ const appIdentifierRegex = /^[A-Za-z0-9][A-Za-z0-9._-]{0,252}$/;
+ if (nextSiteType === "web" && !domainRegex.test(cleanedDomain)) {
+ return reply.status(400).send({
+ success: false,
+ error: "Invalid domain format. Must be a valid domain like example.com or sub.example.com",
+ });
+ }
+ if (nextSiteType === "mobile" && !appIdentifierRegex.test(cleanedDomain)) {
+ return reply.status(400).send({
+ success: false,
+ error: "Invalid app identifier. Use a bundle/package identifier like com.example.app",
+ });
+ }
+ }
+
+ if (nextSiteType === "mobile" && (updateData.sessionReplay || updateData.webVitals)) {
+ return reply.status(400).send({
+ success: false,
+ error: "Session replay and Web Vitals are only available for web sites",
+ });
+ }
+
// Additional validation for excluded IPs if provided
if (updateData.excludedIPs) {
const validationErrors: string[] = [];
@@ -116,7 +140,6 @@ export async function updateSiteConfig(
"embedEnabled",
"saltUserIds",
"blockBots",
- "domain",
"excludedIPs",
"excludedCountries",
"tags",
@@ -139,6 +162,17 @@ export async function updateSiteConfig(
}
}
+ if (updateData.type !== undefined) {
+ dbUpdateData.type = nextSiteType === "web" ? null : nextSiteType;
+ }
+ if (updateData.domain !== undefined) {
+ dbUpdateData.domain = cleanedDomain;
+ }
+ if (nextSiteType === "mobile") {
+ dbUpdateData.sessionReplay = false;
+ dbUpdateData.webVitals = false;
+ }
+
// Only proceed if there are fields to update
if (Object.keys(dbUpdateData).length === 0) {
return reply.status(400).send({
@@ -154,7 +188,7 @@ export async function updateSiteConfig(
await db.update(sites).set(dbUpdateData).where(eq(sites.siteId, siteId));
// Update the site config cache
- await siteConfig.updateConfig(siteId, updateData);
+ await siteConfig.updateConfig(siteId, dbUpdateData);
// Get the updated configuration to return
const updatedConfig = await siteConfig.getConfig(siteId);
diff --git a/server/src/api/user/createUserInOrganization.ts b/server/src/api/user/createUserInOrganization.ts
new file mode 100644
index 000000000..55d1da0b0
--- /dev/null
+++ b/server/src/api/user/createUserInOrganization.ts
@@ -0,0 +1,119 @@
+import { and, eq } from "drizzle-orm";
+import { FastifyReply, FastifyRequest } from "fastify";
+import { randomBytes } from "crypto";
+import { db } from "../../db/postgres/postgres.js";
+import { member } from "../../db/postgres/schema.js";
+import { auth } from "../../lib/auth.js";
+import { getIsUserAdmin } from "../../lib/auth-utils.js";
+
+function generateId(len = 32) {
+ const alphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
+ const bytes = randomBytes(len);
+ let id = "";
+ for (let i = 0; i < len; i++) {
+ id += alphabet[bytes[i] % alphabet.length];
+ }
+ return id;
+}
+
+interface CreateUserInOrganization {
+ Params: {
+ organizationId: string;
+ };
+ Body: {
+ email: string;
+ name?: string;
+ password: string;
+ role: string;
+ };
+}
+
+/**
+ * Creates a new user and adds them to the organization.
+ *
+ * Unlike better-auth's `admin.createUser` (which requires the requester to be a
+ * system-level admin), this endpoint authorizes organization owners/admins to
+ * create users for their own organization. User creation is performed via
+ * better-auth's internal adapter so password hashing and account linking match
+ * the admin plugin exactly.
+ */
+export async function createUserInOrganization(
+ request: FastifyRequest<CreateUserInOrganization>,
+ reply: FastifyReply
+) {
+ try {
+ const { organizationId } = request.params;
+ const { email: rawEmail, name, password, role } = request.body;
+ const userId = request.user?.id;
+
+ // Authorization: system admin OR owner/admin of this organization
+ const isAdmin = await getIsUserAdmin(request);
+ if (!isAdmin) {
+ if (!userId) {
+ return reply.status(401).send({ error: "Unauthorized" });
+ }
+ const userMembership = await db.query.member.findFirst({
+ where: and(eq(member.userId, userId), eq(member.organizationId, organizationId)),
+ });
+ if (!userMembership || (userMembership.role !== "admin" && userMembership.role !== "owner")) {
+ return reply.status(401).send({ error: "Unauthorized" });
+ }
+ }
+
+ // Validate input
+ if (!rawEmail || !password || !role) {
+ return reply.status(400).send({ error: "Missing required fields: email, password and role" });
+ }
+
+ const email = rawEmail.toLowerCase();
+
+ if (role !== "admin" && role !== "member" && role !== "owner") {
+ return reply.status(400).send({ error: "Role must be either admin, member, or owner" });
+ }
+
+ if (password.length < 8) {
+ return reply.status(400).send({ error: "Password must be at least 8 characters long" });
+ }
+
+ const ctx = await auth.$context;
+
+ if (await ctx.internalAdapter.findUserByEmail(email)) {
+ return reply.status(400).send({ error: "A user with this email already exists" });
+ }
+
+ // Create the user + credential account (mirrors better-auth's admin createUser)
+ const createdUser = await ctx.internalAdapter.createUser({
+ email,
+ name: name || email,
+ emailVerified: false,
+ });
+
+ if (!createdUser) {
+ return reply.status(500).send({ error: "Failed to create user" });
+ }
+
+ const hashedPassword = await ctx.password.hash(password);
+ await ctx.internalAdapter.linkAccount({
+ accountId: createdUser.id,
+ providerId: "credential",
+ password: hashedPassword,
+ userId: createdUser.id,
+ });
+
+ // Add the new user to the organization
+ await db.insert(member).values([
+ {
+ userId: createdUser.id,
+ organizationId: organizationId,
+ role: role,
+ id: generateId(),
+ createdAt: new Date().toISOString(),
+ },
+ ]);
+
+ return reply.status(201).send({ message: "User created and added to organization successfully" });
+ } catch (error: any) {
+ console.error(String(error));
+ return reply.status(500).send({ error: String(error) });
+ }
+}
diff --git a/server/src/api/user/index.ts b/server/src/api/user/index.ts
index 8327589f5..081436082 100644
--- a/server/src/api/user/index.ts
+++ b/server/src/api/user/index.ts
@@ -1,5 +1,6 @@
// Organization Management
export { addUserToOrganization } from "./addUserToOrganization.js";
+export { createUserInOrganization } from "./createUserInOrganization.js";
export { getUserOrganizations } from "./getUserOrganizations.js";
export { getMyOrganizations } from "./getMyOrganizations.js";
export { listOrganizationMembers } from "./listOrganizationMembers.js";
diff --git a/server/src/cluster.ts b/server/src/cluster.ts
index 70667febb..d1c5d949f 100644
--- a/server/src/cluster.ts
+++ b/server/src/cluster.ts
@@ -22,7 +22,7 @@ process.on("unhandledRejection", reason => {
});
// Determine worker count from environment variable
-// Default to 0 (single-process mode) if not set.
+// Default to 0 (single-process mode) if not set
const requestedWorkers = process.env.CLUSTER_WORKERS;
const workerCount =
requestedWorkers === undefined || requestedWorkers === ""
diff --git a/server/src/db/clickhouse/clickhouse.ts b/server/src/db/clickhouse/clickhouse.ts
index b703da206..2a81c5d1a 100644
--- a/server/src/db/clickhouse/clickhouse.ts
+++ b/server/src/db/clickhouse/clickhouse.ts
@@ -1,5 +1,5 @@
import { createClient } from "@clickhouse/client";
-import { IS_CLOUD } from "../../lib/const.js";
+import { IS_CLOUD, LITE_DASHBOARD } from "../../lib/const.js";
import { createServiceLogger } from "../../lib/logger/logger.js";
const parsePositiveInt = (value: string | undefined, fallback: number) => {
@@ -287,4 +287,268 @@ export const initializeClickhouse = async () => {
`,
});
}
+
+ if (LITE_DASHBOARD) {
+ await initializeLiteDashboardMVs();
+ }
};
+
+// Materialized views that back the simplified high-traffic dashboard.
+// All views are hourly-bucketed and feed the lite endpoints; raw `events`
+// is still queried for filters that aren't keyed in these MVs.
+async function initializeLiteDashboardMVs() {
+ // Per-session rollup. Replaces the AllSessionPageviews / FilteredSessions
+ // CTEs that getOverview and getOverviewBucketed run over raw events.
+ //
+ // This is a streaming MV: it fires once per inserted block and writes a
+ // PARTIAL session row for whatever events were in that block. AggregatingMergeTree
+ // then composes the SimpleAggregateFunction columns (min/max/sum) across parts
+ // sharing (site_id, session_id), and the read queries additionally re-aggregate
+ // by session_id at query time — so pageviews/start_time/end_time are always
+ // correct even before merges complete.
+ //
+ // The plain metadata columns below (country, region, device_type, browser,
+ // operating_system, hostname) are session-INVARIANT, so every partial row of a
+ // session carries the same value and `any()` is well-defined. Entry/acquisition
+ // attributes (entry_page, referrer, channel) are deliberately NOT stored here:
+ // they are first-event values that differ across a session's blocks, can't be
+ // composed correctly per-partial-row, and so are served by the raw-events
+ // fallback instead (see LITE_SESSION_FILTER_COLUMNS in lite/utils.ts).
+ await clickhouse.exec({
+ query: `
+ CREATE TABLE IF NOT EXISTS sessions_mv_target (
+ site_id UInt16,
+ session_id String,
+ user_id String,
+ start_time SimpleAggregateFunction(min, DateTime),
+ end_time SimpleAggregateFunction(max, DateTime),
+ pageviews SimpleAggregateFunction(sum, UInt64),
+ events SimpleAggregateFunction(sum, UInt64),
+ country LowCardinality(FixedString(2)),
+ region LowCardinality(String),
+ device_type LowCardinality(String),
+ browser LowCardinality(String),
+ operating_system LowCardinality(String),
+ hostname String,
+ last_seen SimpleAggregateFunction(max, DateTime)
+ )
+ ENGINE = AggregatingMergeTree()
+ PARTITION BY toYYYYMM(start_time)
+ ORDER BY (site_id, session_id)
+ `,
+ });
+
+ await clickhouse.exec({
+ query: `
+ CREATE MATERIALIZED VIEW IF NOT EXISTS sessions_mv
+ TO sessions_mv_target
+ AS SELECT
+ site_id,
+ session_id,
+ any(user_id) AS user_id,
+ min(timestamp) AS start_time,
+ max(timestamp) AS end_time,
+ countIf(type = 'pageview') AS pageviews,
+ count() AS events,
+ any(country) AS country,
+ any(region) AS region,
+ any(device_type) AS device_type,
+ any(browser) AS browser,
+ any(operating_system) AS operating_system,
+ any(hostname) AS hostname,
+ max(timestamp) AS last_seen
+ FROM events
+ GROUP BY site_id, session_id
+ `,
+ });
+
+ // Hourly overview rollup. Drives the bucketed chart and overview cards.
+ await clickhouse.exec({
+ query: `
+ CREATE TABLE IF NOT EXISTS overview_hourly_mv_target (
+ site_id UInt16,
+ event_hour DateTime,
+ pageviews SimpleAggregateFunction(sum, UInt64),
+ events SimpleAggregateFunction(sum, UInt64),
+ users AggregateFunction(uniq, String),
+ sessions AggregateFunction(uniq, String)
+ )
+ ENGINE = AggregatingMergeTree()
+ PARTITION BY toYYYYMM(event_hour)
+ ORDER BY (site_id, event_hour)
+ `,
+ });
+
+ await clickhouse.exec({
+ query: `
+ CREATE MATERIALIZED VIEW IF NOT EXISTS overview_hourly_mv
+ TO overview_hourly_mv_target
+ AS SELECT
+ site_id,
+ toStartOfHour(timestamp) AS event_hour,
+ countIf(type = 'pageview') AS pageviews,
+ count() AS events,
+ uniqState(user_id) AS users,
+ uniqState(session_id) AS sessions
+ FROM events
+ GROUP BY site_id, event_hour
+ `,
+ });
+
+ // Top-pathname rollup. Cardinality is bounded by hour, so high-URL sites
+ // still get smaller-than-raw storage. Filtered queries fall back to events.
+ await clickhouse.exec({
+ query: `
+ CREATE TABLE IF NOT EXISTS pathname_hourly_mv_target (
+ site_id UInt16,
+ event_hour DateTime,
+ pathname String,
+ hostname String,
+ pageviews SimpleAggregateFunction(sum, UInt64),
+ users AggregateFunction(uniq, String),
+ sessions AggregateFunction(uniq, String)
+ )
+ ENGINE = AggregatingMergeTree()
+ PARTITION BY toYYYYMM(event_hour)
+ ORDER BY (site_id, event_hour, pathname)
+ `,
+ });
+
+ await clickhouse.exec({
+ query: `
+ CREATE MATERIALIZED VIEW IF NOT EXISTS pathname_hourly_mv
+ TO pathname_hourly_mv_target
+ AS SELECT
+ site_id,
+ toStartOfHour(timestamp) AS event_hour,
+ pathname,
+ any(hostname) AS hostname,
+ countIf(type = 'pageview') AS pageviews,
+ uniqState(user_id) AS users,
+ uniqState(session_id) AS sessions
+ FROM events
+ WHERE type = 'pageview'
+ GROUP BY site_id, event_hour, pathname
+ `,
+ });
+
+ // Country/region rollup. Cardinality is naturally bounded.
+ await clickhouse.exec({
+ query: `
+ CREATE TABLE IF NOT EXISTS country_hourly_mv_target (
+ site_id UInt16,
+ event_hour DateTime,
+ country LowCardinality(FixedString(2)),
+ region LowCardinality(String),
+ pageviews SimpleAggregateFunction(sum, UInt64),
+ users AggregateFunction(uniq, String),
+ sessions AggregateFunction(uniq, String)
+ )
+ ENGINE = AggregatingMergeTree()
+ PARTITION BY toYYYYMM(event_hour)
+ ORDER BY (site_id, event_hour, country, region)
+ `,
+ });
+
+ await clickhouse.exec({
+ query: `
+ CREATE MATERIALIZED VIEW IF NOT EXISTS country_hourly_mv
+ TO country_hourly_mv_target
+ AS SELECT
+ site_id,
+ toStartOfHour(timestamp) AS event_hour,
+ country,
+ region,
+ countIf(type = 'pageview') AS pageviews,
+ uniqState(user_id) AS users,
+ uniqState(session_id) AS sessions
+ FROM events
+ GROUP BY site_id, event_hour, country, region
+ `,
+ });
+
+ // Device-type rollup.
+ await clickhouse.exec({
+ query: `
+ CREATE TABLE IF NOT EXISTS device_type_hourly_mv_target (
+ site_id UInt16,
+ event_hour DateTime,
+ device_type LowCardinality(String),
+ pageviews SimpleAggregateFunction(sum, UInt64),
+ users AggregateFunction(uniq, String),
+ sessions AggregateFunction(uniq, String)
+ )
+ ENGINE = AggregatingMergeTree()
+ PARTITION BY toYYYYMM(event_hour)
+ ORDER BY (site_id, event_hour, device_type)
+ `,
+ });
+
+ await clickhouse.exec({
+ query: `
+ CREATE MATERIALIZED VIEW IF NOT EXISTS device_type_hourly_mv
+ TO device_type_hourly_mv_target
+ AS SELECT
+ site_id,
+ toStartOfHour(timestamp) AS event_hour,
+ device_type,
+ countIf(type = 'pageview') AS pageviews,
+ uniqState(user_id) AS users,
+ uniqState(session_id) AS sessions
+ FROM events
+ GROUP BY site_id, event_hour, device_type
+ `,
+ });
+
+ // Session-keyed hourly rollup, populated by a REFRESHABLE materialized view.
+ // Streaming MVs can't compute bounce_rate or session_duration because they
+ // see one event at a time, never the full per-session state. The refreshable
+ // MV re-runs its SELECT every 5 minutes against the fully-merged sessions,
+ // which is cheap (~720 rows/site/month) and unlocks all 6 overview metrics
+ // from a single table read.
+ await clickhouse.exec({
+ query: `
+ CREATE TABLE IF NOT EXISTS session_hourly_mv_target (
+ site_id UInt16,
+ session_hour DateTime,
+ sessions UInt64,
+ pageviews UInt64,
+ users AggregateFunction(uniq, String),
+ total_session_duration_seconds UInt64,
+ bounced_sessions UInt64
+ )
+ ENGINE = MergeTree()
+ PARTITION BY toYYYYMM(session_hour)
+ ORDER BY (site_id, session_hour)
+ `,
+ });
+
+ await clickhouse.exec({
+ query: `
+ CREATE MATERIALIZED VIEW IF NOT EXISTS session_hourly_mv
+ REFRESH EVERY 5 MINUTE
+ TO session_hourly_mv_target
+ AS
+ SELECT
+ site_id,
+ toStartOfHour(session_start) AS session_hour,
+ count() AS sessions,
+ sum(session_pageviews) AS pageviews,
+ uniqState(user_id) AS users,
+ sum(toUInt64(session_end - session_start)) AS total_session_duration_seconds,
+ countIf(session_pageviews = 1) AS bounced_sessions
+ FROM (
+ SELECT
+ site_id,
+ session_id,
+ any(user_id) AS user_id,
+ countIf(type = 'pageview') AS session_pageviews,
+ min(timestamp) AS session_start,
+ max(timestamp) AS session_end
+ FROM events
+ GROUP BY site_id, session_id
+ ) AS s
+ GROUP BY site_id, session_hour
+ `,
+ });
+}
diff --git a/server/src/db/postgres/schema.ts b/server/src/db/postgres/schema.ts
index 3f99457f7..96d80c943 100644
--- a/server/src/db/postgres/schema.ts
+++ b/server/src/db/postgres/schema.ts
@@ -57,37 +57,42 @@ export const verification = pgTable("verification", {
});
// Sites table
-export const sites = pgTable("sites", {
- id: text("id").$defaultFn(() => sql`encode(gen_random_bytes(6), 'hex')`),
- // deprecated - keeping as primary key for backwards compatibility
- siteId: serial("site_id").primaryKey().notNull(),
- name: text("name").notNull(),
- domain: text("domain").notNull(),
- createdAt: timestamp("created_at", { mode: "string" }).defaultNow(),
- updatedAt: timestamp("updated_at", { mode: "string" }).defaultNow(),
- createdBy: text("created_by").references(() => user.id, { onDelete: "set null" }),
- organizationId: text("organization_id").references(() => organization.id),
- public: boolean().default(false),
- embedEnabled: boolean("embed_enabled").default(false),
- saltUserIds: boolean().default(false),
- blockBots: boolean().default(true).notNull(),
- excludedIPs: jsonb("excluded_ips").default([]), // Array of IP addresses/ranges to exclude
- excludedCountries: jsonb("excluded_countries").default([]), // Array of ISO country codes to exclude (e.g., ["US", "GB"])
- sessionReplay: boolean().default(false),
- webVitals: boolean().default(false),
- trackErrors: boolean().default(false),
- trackOutbound: boolean().default(true),
- trackUrlParams: boolean().default(true),
- trackInitialPageView: boolean().default(true),
- trackSpaNavigation: boolean().default(true),
- trackIp: boolean().default(false),
- trackButtonClicks: boolean().default(false),
- trackCopy: boolean().default(false),
- trackFormInteractions: boolean().default(false),
- apiKey: text("api_key"), // Format: rb_{64_hex_chars} = 67 chars total
- privateLinkKey: text("private_link_key"),
- tags: jsonb("tags").default([]).$type<string[]>(),
-});
+export const sites = pgTable(
+ "sites",
+ {
+ id: text("id").$defaultFn(() => sql`encode(gen_random_bytes(6), 'hex')`),
+ // deprecated - keeping as primary key for backwards compatibility
+ siteId: serial("site_id").primaryKey().notNull(),
+ name: text("name").notNull(),
+ type: text("type").$type<"web" | "mobile" | null>(),
+ domain: text("domain").notNull(),
+ createdAt: timestamp("created_at", { mode: "string" }).defaultNow(),
+ updatedAt: timestamp("updated_at", { mode: "string" }).defaultNow(),
+ createdBy: text("created_by").references(() => user.id, { onDelete: "set null" }),
+ organizationId: text("organization_id").references(() => organization.id),
+ public: boolean().default(false),
+ embedEnabled: boolean("embed_enabled").default(false),
+ saltUserIds: boolean().default(false),
+ blockBots: boolean().default(true).notNull(),
+ excludedIPs: jsonb("excluded_ips").default([]), // Array of IP addresses/ranges to exclude
+ excludedCountries: jsonb("excluded_countries").default([]), // Array of ISO country codes to exclude (e.g., ["US", "GB"])
+ sessionReplay: boolean().default(false),
+ webVitals: boolean().default(false),
+ trackErrors: boolean().default(false),
+ trackOutbound: boolean().default(true),
+ trackUrlParams: boolean().default(true),
+ trackInitialPageView: boolean().default(true),
+ trackSpaNavigation: boolean().default(true),
+ trackIp: boolean().default(false),
+ trackButtonClicks: boolean().default(false),
+ trackCopy: boolean().default(false),
+ trackFormInteractions: boolean().default(false),
+ apiKey: text("api_key"), // Format: rb_{64_hex_chars} = 67 chars total
+ privateLinkKey: text("private_link_key"),
+ tags: jsonb("tags").default([]).$type<string[]>(),
+ },
+ table => [check("sites_type_check", sql`${table.type} IS NULL OR ${table.type} IN ('web', 'mobile')`)]
+);
// Active sessions table
export const activeSessions = pgTable("active_sessions", {
diff --git a/server/src/index.ts b/server/src/index.ts
index 37095a89c..55a38fe1f 100644
--- a/server/src/index.ts
+++ b/server/src/index.ts
@@ -38,10 +38,13 @@ import {
getJourneys,
getLiveUsercount,
getMetric,
+ getMetricLite,
getOrgEventCount,
getOutboundLinks,
getOverview,
getOverviewBucketed,
+ getOverviewBucketedLite,
+ getOverviewLite,
getPageTitles,
getPerformanceByDimension,
getPerformanceOverview,
@@ -124,6 +127,7 @@ import {
import {
addUserToOrganization,
createUserApiKey,
+ createUserInOrganization,
getMyOrganizations,
getUserOrganizations,
listOrganizationMembers,
@@ -258,6 +262,9 @@ async function analyticsRoutes(fastify: FastifyInstance) {
fastify.get("/sites/:siteId/live-user-count", { logLevel: "silent", ...publicSite }, getLiveUsercount);
fastify.get("/sites/:siteId/overview", publicSite, getOverview);
fastify.get("/sites/:siteId/overview-bucketed", publicSite, getOverviewBucketed);
+ fastify.get("/sites/:siteId/overview-lite", publicSite, getOverviewLite);
+ fastify.get("/sites/:siteId/overview-bucketed-lite", publicSite, getOverviewBucketedLite);
+ fastify.get("/sites/:siteId/metric-lite", publicSite, getMetricLite);
fastify.get("/sites/:siteId/metric", publicSite, getMetric);
fastify.get("/sites/:siteId/page-titles", publicSite, getPageTitles);
fastify.get("/sites/:siteId/error-names", publicSite, getErrorNames);
@@ -354,6 +361,7 @@ async function organizationsRoutes(fastify: FastifyInstance) {
fastify.post("/organizations/:organizationId/sites", orgAdminParams, addSite);
fastify.get("/organizations/:organizationId/members", orgMember, listOrganizationMembers);
fastify.post("/organizations/:organizationId/members", authOnly, addUserToOrganization);
+ fastify.post("/organizations/:organizationId/users", authOnly, createUserInOrganization);
// Member site access management (admin/owner only)
fastify.put("/organizations/:organizationId/members/:memberId/sites", orgAdminParams, updateMemberSiteAccess);
@@ -393,6 +401,10 @@ async function stripeAdminRoutes(fastify: FastifyInstance) {
// ClickHouse stats (available for all admins)
fastify.get("/admin/clickhouse-stats", adminOnly, getClickhouseStats);
fastify.get("/admin/clickhouse-query-log", adminOnly, getClickhouseQueryLog);
+ fastify.get("/admin/sites", adminOnly, getAdminSites);
+ fastify.get("/admin/organizations", adminOnly, getAdminOrganizations);
+ fastify.get("/admin/service-event-count", adminOnly, getAdminServiceEventCount);
+ fastify.post("/admin/telemetry", collectTelemetry); // Public - telemetry collection
// STRIPE & ADMIN
if (IS_CLOUD) {
@@ -406,12 +418,7 @@ async function stripeAdminRoutes(fastify: FastifyInstance) {
fastify.post("/stripe/cancellation-feedback", authOnly, submitCancellationFeedback);
fastify.post("/stripe/webhook", { config: { rawBody: true } }, handleWebhook); // Public - Stripe webhook
- // Admin Routes
- fastify.get("/admin/sites", adminOnly, getAdminSites);
- fastify.get("/admin/organizations", adminOnly, getAdminOrganizations);
- fastify.get("/admin/service-event-count", adminOnly, getAdminServiceEventCount);
- fastify.post("/admin/telemetry", collectTelemetry); // Public - telemetry collection
-
+ // AppSumo Routes
fastify.post("/as/activate", authOnly, activateAppSumoLicense);
fastify.post("/as/webhook", handleAppSumoWebhook); // Public - AppSumo webhook
}
diff --git a/server/src/lib/const.ts b/server/src/lib/const.ts
index 6152acbb7..1dbdb5628 100644
--- a/server/src/lib/const.ts
+++ b/server/src/lib/const.ts
@@ -3,8 +3,10 @@ import dotenv from "dotenv";
dotenv.config();
export const IS_CLOUD = process.env.CLOUD === "true";
+export const DEPLOYMENT = process.env.DEPLOYMENT;
export const DISABLE_SIGNUP = process.env.DISABLE_SIGNUP === "true";
export const DISABLE_TELEMETRY = process.env.DISABLE_TELEMETRY === "true";
+export const LITE_DASHBOARD = process.env.LITE_DASHBOARD === "true";
export const SECRET = process.env.BETTER_AUTH_SECRET;
export const MAPBOX_TOKEN = process.env.MAPBOX_TOKEN;
diff --git a/server/src/lib/siteConfig.ts b/server/src/lib/siteConfig.ts
index 8639ec5e0..03deb6668 100644
--- a/server/src/lib/siteConfig.ts
+++ b/server/src/lib/siteConfig.ts
@@ -8,6 +8,7 @@ import { logger } from "./logger/logger.js";
export interface SiteConfigData {
id: string | null;
siteId: number;
+ type: "web" | "mobile";
public: boolean;
embedEnabled: boolean;
saltUserIds: boolean;
@@ -91,6 +92,7 @@ class SiteConfig {
const configData: SiteConfigData = {
id: site.id,
siteId: site.siteId,
+ type: site.type || "web",
public: site.public || false,
embedEnabled: site.embedEnabled || false,
saltUserIds: site.saltUserIds || false,
diff --git a/server/src/scripts/backfillLiteDashboardMVs.ts b/server/src/scripts/backfillLiteDashboardMVs.ts
new file mode 100644
index 000000000..930c9301b
--- /dev/null
+++ b/server/src/scripts/backfillLiteDashboardMVs.ts
@@ -0,0 +1,241 @@
+// Backfill the lite-dashboard materialized view targets from the existing
+// `events` table. Materialized views only see new inserts, so after enabling
+// LITE_DASHBOARD on a deployment that already has data, run this once.
+//
+// Usage:
+// tsc && node dist/scripts/backfillLiteDashboardMVs.js [options]
+//
+// Options:
+// --cutoff <YYYY-MM-DD HH:MM:SS> Only backfill events strictly before this
+// timestamp. Default: now() minus 1 minute.
+// The MV captures rows >= cutoff live, so
+// pick a value at/just-before the moment
+// LITE_DASHBOARD was first enabled.
+// --from <YYYY-MM-DD> Lower bound (inclusive). Default: no bound.
+// --truncate TRUNCATE target tables first. Required if
+// re-running — AggregatingMergeTree is not
+// idempotent on re-insert.
+// --tables sessions,overview,... Subset to backfill. Default: all targets.
+// --dry-run Print SQL without executing.
+
+import { clickhouse } from "../db/clickhouse/clickhouse.js";
+
+type TableKey = "sessions" | "overview" | "pathname" | "country" | "device_type";
+
+const ALL_TABLES: TableKey[] = ["sessions", "overview", "pathname", "country", "device_type"];
+
+const TARGET_TABLES: Record<TableKey, string> = {
+ sessions: "sessions_mv_target",
+ overview: "overview_hourly_mv_target",
+ pathname: "pathname_hourly_mv_target",
+ country: "country_hourly_mv_target",
+ device_type: "device_type_hourly_mv_target",
+};
+
+// Each SELECT mirrors the MV definition in clickhouse.ts. Keep in sync.
+function buildSelectQuery(table: TableKey, where: string): string {
+ switch (table) {
+ case "sessions":
+ return `
+ SELECT
+ site_id,
+ session_id,
+ any(user_id) AS user_id,
+ min(timestamp) AS start_time,
+ max(timestamp) AS end_time,
+ countIf(type = 'pageview') AS pageviews,
+ count() AS events,
+ any(country) AS country,
+ any(region) AS region,
+ any(device_type) AS device_type,
+ any(browser) AS browser,
+ any(operating_system) AS operating_system,
+ any(hostname) AS hostname,
+ max(timestamp) AS last_seen
+ FROM events
+ ${where}
+ GROUP BY site_id, session_id
+ `;
+ case "overview":
+ return `
+ SELECT
+ site_id,
+ toStartOfHour(timestamp) AS event_hour,
+ countIf(type = 'pageview') AS pageviews,
+ count() AS events,
+ uniqState(user_id) AS users,
+ uniqState(session_id) AS sessions
+ FROM events
+ ${where}
+ GROUP BY site_id, event_hour
+ `;
+ case "pathname":
+ return `
+ SELECT
+ site_id,
+ toStartOfHour(timestamp) AS event_hour,
+ pathname,
+ any(hostname) AS hostname,
+ countIf(type = 'pageview') AS pageviews,
+ uniqState(user_id) AS users,
+ uniqState(session_id) AS sessions
+ FROM events
+ ${where} ${where ? "AND" : "WHERE"} type = 'pageview'
+ GROUP BY site_id, event_hour, pathname
+ `;
+ case "country":
+ return `
+ SELECT
+ site_id,
+ toStartOfHour(timestamp) AS event_hour,
+ country,
+ region,
+ countIf(type = 'pageview') AS pageviews,
+ uniqState(user_id) AS users,
+ uniqState(session_id) AS sessions
+ FROM events
+ ${where}
+ GROUP BY site_id, event_hour, country, region
+ `;
+ case "device_type":
+ return `
+ SELECT
+ site_id,
+ toStartOfHour(timestamp) AS event_hour,
+ device_type,
+ countIf(type = 'pageview') AS pageviews,
+ uniqState(user_id) AS users,
+ uniqState(session_id) AS sessions
+ FROM events
+ ${where}
+ GROUP BY site_id, event_hour, device_type
+ `;
+ }
+}
+
+function parseArgs() {
+ const args = process.argv.slice(2);
+ let cutoff: string | undefined;
+ let from: string | undefined;
+ let truncate = false;
+ let dryRun = false;
+ let tables: TableKey[] = ALL_TABLES;
+
+ for (let i = 0; i < args.length; i++) {
+ const a = args[i];
+ if (a === "--cutoff") cutoff = args[++i];
+ else if (a === "--from") from = args[++i];
+ else if (a === "--truncate") truncate = true;
+ else if (a === "--dry-run") dryRun = true;
+ else if (a === "--tables") {
+ const list = args[++i]?.split(",").map(s => s.trim()) ?? [];
+ const invalid = list.filter(t => !ALL_TABLES.includes(t as TableKey));
+ if (invalid.length) throw new Error(`Unknown table(s): ${invalid.join(", ")}`);
+ tables = list as TableKey[];
+ } else if (a === "--help" || a === "-h") {
+ console.log(
+ "Usage: node dist/scripts/backfillLiteDashboardMVs.js [--cutoff '<ts>'] [--from <date>] [--truncate] [--tables a,b] [--dry-run]"
+ );
+ process.exit(0);
+ } else {
+ throw new Error(`Unknown arg: ${a}`);
+ }
+ }
+
+ return { cutoff, from, truncate, dryRun, tables };
+}
+
+// Iterate month-by-month so we never load >1 month of events into a single
+// aggregation. Without this, ClickHouse can OOM on very large `events` tables.
+async function* monthRanges(
+ from: Date,
+ to: Date
+): AsyncGenerator<{ start: string; end: string; label: string }> {
+ let cursor = new Date(Date.UTC(from.getUTCFullYear(), from.getUTCMonth(), 1));
+ while (cursor < to) {
+ const next = new Date(Date.UTC(cursor.getUTCFullYear(), cursor.getUTCMonth() + 1, 1));
+ const start = cursor < from ? from : cursor;
+ const end = next > to ? to : next;
+ yield {
+ start: start.toISOString().slice(0, 19).replace("T", " "),
+ end: end.toISOString().slice(0, 19).replace("T", " "),
+ label: cursor.toISOString().slice(0, 7),
+ };
+ cursor = next;
+ }
+}
+
+async function getEventsRange(): Promise<{ minTs: Date | null; maxTs: Date | null }> {
+ const result = await clickhouse.query({
+ query: "SELECT min(timestamp) AS min_ts, max(timestamp) AS max_ts FROM events",
+ format: "JSONEachRow",
+ });
+ const rows = (await result.json()) as Array<{ min_ts: string; max_ts: string }>;
+ const row = rows[0];
+ if (!row || !row.min_ts || row.min_ts === "1970-01-01 00:00:00") return { minTs: null, maxTs: null };
+ return {
+ minTs: new Date(row.min_ts.replace(" ", "T") + "Z"),
+ maxTs: new Date(row.max_ts.replace(" ", "T") + "Z"),
+ };
+}
+
+async function main() {
+ const opts = parseArgs();
+
+ const cutoff = opts.cutoff
+ ? new Date(opts.cutoff.replace(" ", "T") + "Z")
+ : new Date(Date.now() - 60 * 1000);
+
+ const eventsRange = await getEventsRange();
+ if (!eventsRange.minTs || !eventsRange.maxTs) {
+ console.log("events table is empty — nothing to backfill.");
+ return;
+ }
+
+ const from = opts.from
+ ? new Date(opts.from + "T00:00:00Z")
+ : eventsRange.minTs;
+ const to = cutoff < eventsRange.maxTs ? cutoff : eventsRange.maxTs;
+
+ console.log(`Backfilling tables: ${opts.tables.join(", ")}`);
+ console.log(`Range: ${from.toISOString()} → ${to.toISOString()}`);
+ console.log(`Mode: ${opts.dryRun ? "DRY-RUN" : opts.truncate ? "TRUNCATE+INSERT" : "INSERT"}`);
+
+ if (opts.truncate && !opts.dryRun) {
+ for (const table of opts.tables) {
+ const target = TARGET_TABLES[table];
+ console.log(`\nTRUNCATE ${target}`);
+ await clickhouse.exec({ query: `TRUNCATE TABLE ${target}` });
+ }
+ }
+
+ for (const table of opts.tables) {
+ const target = TARGET_TABLES[table];
+ console.log(`\n=== ${table} → ${target} ===`);
+
+ for await (const month of monthRanges(from, to)) {
+ const where = `WHERE timestamp >= toDateTime('${month.start}') AND timestamp < toDateTime('${month.end}')`;
+ const select = buildSelectQuery(table, where);
+ const insertSql = `INSERT INTO ${target}\n${select}`;
+
+ const t0 = Date.now();
+ if (opts.dryRun) {
+ console.log(`-- ${month.label}`);
+ console.log(insertSql.trim());
+ } else {
+ process.stdout.write(` ${month.label}... `);
+ await clickhouse.exec({ query: insertSql });
+ console.log(`${((Date.now() - t0) / 1000).toFixed(1)}s`);
+ }
+ }
+ }
+
+ console.log("\nDone. Run OPTIMIZE TABLE ... FINAL on each target if you want immediate part merging.");
+}
+
+main()
+ .then(() => process.exit(0))
+ .catch(err => {
+ console.error(err);
+ process.exit(1);
+ });
diff --git a/server/src/services/tracker/identifyService.ts b/server/src/services/tracker/identifyService.ts
index 546fd4c4a..b2c681e58 100644
--- a/server/src/services/tracker/identifyService.ts
+++ b/server/src/services/tracker/identifyService.ts
@@ -17,7 +17,10 @@ const MAX_TRAITS_SIZE = 2048;
// Validation schema for identify requests
const identifyPayloadSchema = z.object({
site_id: z.string().min(1),
+ anonymous_id: z.string().min(1).max(255).optional(),
user_id: z.string().min(1).max(255),
+ ip_address: z.string().ip().optional(),
+ user_agent: z.string().max(512).optional(),
traits: z
.record(z.unknown())
.optional()
@@ -36,11 +39,7 @@ const identifyPayloadSchema = z.object({
// Anonymous events older than this are unlikely to belong to the identifying user.
const BACKFILL_DAYS = 30;
-async function backfillIdentifiedUserId(
- siteId: number,
- anonymousId: string,
- userId: string
-) {
+async function backfillIdentifiedUserId(siteId: number, anonymousId: string, userId: string) {
try {
const tables = ["events", "session_replay_events", "session_replay_metadata"];
for (const table of tables) {
@@ -67,7 +66,7 @@ export async function handleIdentify(request: FastifyRequest, reply: FastifyRepl
});
}
- const { site_id, user_id, traits, is_new_identify } = validationResult.data;
+ const { site_id, anonymous_id, user_id, traits, is_new_identify, ip_address, user_agent } = validationResult.data;
// Get site configuration
const siteConfiguration = await siteConfig.getConfig(site_id);
@@ -80,10 +79,13 @@ export async function handleIdentify(request: FastifyRequest, reply: FastifyRepl
const siteId = siteConfiguration.siteId;
- // Compute anonymous_id from request (same logic as tracking)
- const ipAddress = getIpAddress(request);
- const userAgent = request.headers["user-agent"] || "";
- const anonymousId = await userIdService.generateUserId(ipAddress, userAgent, siteId);
+ const anonymousId = anonymous_id
+ ? await userIdService.generateUserIdFromClientId(anonymous_id, siteId)
+ : await userIdService.generateUserId(
+ ip_address || getIpAddress(request),
+ user_agent || request.headers["user-agent"] || "",
+ siteId
+ );
// Create alias if this is a new identify call (links anonymous_id to user_id)
if (is_new_identify) {
@@ -91,10 +93,7 @@ export async function handleIdentify(request: FastifyRequest, reply: FastifyRepl
// discoverable via search/inventory queries even when no traits are set,
// and so createdAt reflects identification time rather than first setTraits.
try {
- await db
- .insert(userProfiles)
- .values({ siteId, userId: user_id })
- .onConflictDoNothing();
+ await db.insert(userProfiles).values({ siteId, userId: user_id }).onConflictDoNothing();
} catch (error) {
logger.error({ siteId, userId: user_id, error }, "Error creating user profile shell");
}
@@ -132,9 +131,7 @@ export async function handleIdentify(request: FastifyRequest, reply: FastifyRepl
// Atomic upsert: merge non-null traits and remove keys explicitly set to null.
if (traits && Object.keys(traits).length > 0) {
try {
- const filteredTraits = Object.fromEntries(
- Object.entries(traits).filter(([_, v]) => v !== null)
- );
+ const filteredTraits = Object.fromEntries(Object.entries(traits).filter(([_, v]) => v !== null));
const nullKeys = Object.entries(traits)
.filter(([_, v]) => v === null)
.map(([k]) => k);
diff --git a/server/src/services/tracker/trackEvent.ts b/server/src/services/tracker/trackEvent.ts
index 100fe688f..11c98d7c1 100644
--- a/server/src/services/tracker/trackEvent.ts
+++ b/server/src/services/tracker/trackEvent.ts
@@ -23,6 +23,7 @@ const baseEventFields = {
language: z.string().max(35).optional(),
page_title: z.string().max(512).optional(),
referrer: z.string().max(2048).optional(),
+ anonymous_id: z.string().min(1).max(255).optional(),
user_id: z.string().max(255).optional(),
tag: z.string().max(256).optional(),
feature_flags: z.record(z.string().max(100), z.string().max(2048)).optional(),
diff --git a/server/src/services/tracker/utils.ts b/server/src/services/tracker/utils.ts
index caf5ccda3..5a681f714 100644
--- a/server/src/services/tracker/utils.ts
+++ b/server/src/services/tracker/utils.ts
@@ -112,8 +112,9 @@ export async function createBasePayload(
const { ipAddress, userAgent } = resolveTrackingIdentity(request, validatedBody, trustedServerSideIngestion);
const { ip_address: _ipAddressOverride, user_agent: _userAgentOverride, ...payloadBody } = validatedBody;
- // Always compute anonymous_id based on IP+UserAgent (device fingerprint)
- const anonymousId = await userIdService.generateUserId(ipAddress, userAgent, siteConfiguration.siteId);
+ const anonymousId = validatedBody.anonymous_id
+ ? await userIdService.generateUserIdFromClientId(validatedBody.anonymous_id, siteConfiguration.siteId)
+ : await userIdService.generateUserId(ipAddress, userAgent, siteConfiguration.siteId);
// userId is always the device fingerprint
// identifiedUserId is the custom user ID when provided, empty string otherwise
diff --git a/server/src/services/userId/userIdService.ts b/server/src/services/userId/userIdService.ts
index a2e3cfb0d..3b6a33e51 100644
--- a/server/src/services/userId/userIdService.ts
+++ b/server/src/services/userId/userIdService.ts
@@ -66,6 +66,13 @@ class UserIdService {
.digest("hex")
.substring(0, 12);
}
+
+ async generateUserIdFromClientId(clientId: string, siteId: number): Promise<string> {
+ const config = await siteConfig.getConfig(siteId);
+ const salt = config?.saltUserIds ? this.getDailySalt() : "";
+
+ return crypto.createHash("sha256").update(`${siteId}:${clientId}:${salt}`).digest("hex").substring(0, 12);
+ }
}
export const userIdService = new UserIdService();