Skip to content

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

Remove unused deps

Bill Yanga4c59f9edf0e
diff --git a/client/package.json b/client/package.json
index 9535445b8..c746ebc31 100644
--- a/client/package.json
+++ b/client/package.json
@@ -21,6 +21,7 @@
"@nivo/theming": "0.96.0",
"@number-flow/react": "0.5.9",
"@radix-ui/react-alert-dialog": "1.1.13",
+ "@radix-ui/react-visually-hidden": "1.2.4",
"@radix-ui/react-checkbox": "^1.3.2",
"@radix-ui/react-dialog": "1.1.13",
"@radix-ui/react-dropdown-menu": "2.1.14",
@@ -36,15 +37,12 @@
"@radix-ui/react-switch": "1.2.4",
"@radix-ui/react-tabs": "1.1.11",
"@radix-ui/react-tooltip": "1.2.6",
- "@radix-ui/react-visually-hidden": "1.2.2",
- "@radix-ui/themes": "3.2.1",
"@rybbit/shared": "file:../shared",
"@tanstack/react-query": "5.76.0",
"@tanstack/react-query-devtools": "5.76.0",
"@tanstack/react-table": "8.21.3",
"@types/country-flag-icons": "1.2.2",
"@types/papaparse": "^5.5.0",
- "@types/three": "0.176.0",
"@uidotdev/usehooks": "2.4.1",
"axios": "^1.9.0",
"better-auth": "1.3.27",
@@ -72,16 +70,13 @@
"react": "19.1.0",
"react-day-picker": "^8.10.1",
"react-dom": "19.1.0",
- "react-globe.gl": "2.33.2",
"react-hook-form": "7.56.3",
"react-scan": "^0.3.4",
"react-select": "5.10.1",
- "rrweb": "^2.0.0-alpha.11",
"rrweb-player": "^2.0.0-alpha.11",
"sonner": "2.0.3",
"tailwind-merge": "2.6.0",
"tailwindcss-animate": "1.0.7",
- "three": "0.176.0",
"unique-names-generator": "^4.7.1",
"zod": "3.24.4",
"zustand": "5.0.4"
diff --git a/client/src/app/[site]/[privateKey]/realtime/page.tsx b/client/src/app/[site]/[privateKey]/realtime/page.tsx
deleted file mode 100644
index 7af47b02e..000000000
--- a/client/src/app/[site]/[privateKey]/realtime/page.tsx
+++ /dev/null
@@ -1,2 +0,0 @@
-// Re-export the realtime page for private link routes
-export { default } from "../../realtime/page";
diff --git a/client/src/app/[site]/components/Sidebar/MobileSidebar.tsx b/client/src/app/[site]/components/Sidebar/MobileSidebar.tsx
index 71bcb310d..4353865ee 100644
--- a/client/src/app/[site]/components/Sidebar/MobileSidebar.tsx
+++ b/client/src/app/[site]/components/Sidebar/MobileSidebar.tsx
@@ -7,7 +7,7 @@ import { Button } from "../../../../components/ui/button";
import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from "../../../../components/ui/sheet";
import { Menu } from "lucide-react";
-import { VisuallyHidden } from "radix-ui";
+import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
import { Favicon } from "../../../../components/Favicon";
import { AppSidebar } from "../../../../components/AppSidebar";
import { useEmbedablePage } from "../../utils";
@@ -28,11 +28,11 @@ function MobileSidebarContent() {
<Menu />
</Button>
</SheetTrigger>
- <VisuallyHidden.Root>
+ <VisuallyHidden>
<SheetHeader>
<SheetTitle>Rybbit Sidebar</SheetTitle>
</SheetHeader>
- </VisuallyHidden.Root>
+ </VisuallyHidden>
<SheetContent side="left" className="p-0 w-[240px] flex gap-0" showClose={false}>
<AppSidebar />
<Sidebar />
diff --git a/client/src/app/[site]/components/Sidebar/Sidebar.tsx b/client/src/app/[site]/components/Sidebar/Sidebar.tsx
index 923216f69..6cfe8144f 100644
--- a/client/src/app/[site]/components/Sidebar/Sidebar.tsx
+++ b/client/src/app/[site]/components/Sidebar/Sidebar.tsx
@@ -24,8 +24,10 @@ import { authClient } from "../../../../lib/auth";
import { IS_CLOUD } from "../../../../lib/const";
import { useEmbedablePage } from "../../utils";
import { SiteSelector } from "./SiteSelector";
+import { useStripeSubscription } from "../../../../lib/subscription/useStripeSubscription";
function SidebarContent() {
+ const { data: subscription, isLoading: isSubscriptionLoading } = useStripeSubscription();
const session = authClient.useSession();
const pathname = usePathname();
const embed = useEmbedablePage();
@@ -74,20 +76,6 @@ function SidebarContent() {
href={getTabPath("main")}
icon={<LayoutDashboard className="w-4 h-4" />}
/>
- {/* <SidebarComponents.Item
- label="Realtime"
- active={isActiveTab("realtime")}
- href={getTabPath("realtime")}
- icon={<Earth className="w-4 h-4" />}
- /> */}
- {/* {!IS_CLOUD && (
- <SidebarComponents.Item
- label="Map"
- active={isActiveTab("map")}
- href={getTabPath("map")}
- icon={<Map className="w-4 h-4" />}
- />
- )} */}
<SidebarComponents.Item
label="Globe"
active={isActiveTab("globe")}
@@ -118,12 +106,14 @@ function SidebarContent() {
/>
<SidebarComponents.SectionHeader>Product Analytics</SidebarComponents.SectionHeader>
<div className="hidden md:block">
- <SidebarComponents.Item
- label="Replay"
- active={isActiveTab("replay")}
- href={getTabPath("replay")}
- icon={<Video className="w-4 h-4" />}
- />
+ {!subscription?.planName?.startsWith("appsumo") && !isSubscriptionLoading && (
+ <SidebarComponents.Item
+ label="Replay"
+ active={isActiveTab("replay")}
+ href={getTabPath("replay")}
+ icon={<Video className="w-4 h-4" />}
+ />
+ )}
</div>
<SidebarComponents.Item
label="Funnels"
diff --git a/client/src/app/[site]/globe/components/GlobeSessions.tsx b/client/src/app/[site]/globe/components/GlobeSessions.tsx
index 334d4455f..1bcbf8676 100644
--- a/client/src/app/[site]/globe/components/GlobeSessions.tsx
+++ b/client/src/app/[site]/globe/components/GlobeSessions.tsx
@@ -1,8 +1,7 @@
-import { ArrowRight, ChevronDown, ChevronUp, ExternalLink } from "lucide-react";
+import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
+import { ArrowRight, ChevronDown, ChevronUp } from "lucide-react";
import { DateTime } from "luxon";
-import Link from "next/link";
import { useMemo, useState } from "react";
-import { VisuallyHidden } from "radix-ui";
import { useCurrentSite } from "../../../../api/admin/sites";
import { GetSessionsResponse, useGetSessionsInfinite } from "../../../../api/analytics/useGetUserSessions";
import { Avatar, generateName } from "../../../../components/Avatar";
@@ -205,9 +204,9 @@ export function GlobeSessions() {
</div>
<Dialog open={!!selectedSession} onOpenChange={open => !open && setSelectedSession(null)}>
- <VisuallyHidden.Root>
+ <VisuallyHidden>
<DialogTitle>Session Details</DialogTitle>
- </VisuallyHidden.Root>
+ </VisuallyHidden>
<DialogContent className="max-w-4xl max-h-[80vh] overflow-y-auto bg-transparent border-0 p-0 shadow-none gap-0 [&>button]:hidden">
{selectedSession && <FullSessionCard session={selectedSession} expandedByDefault />}
</DialogContent>
diff --git a/client/src/app/[site]/globe/page.tsx b/client/src/app/[site]/globe/page.tsx
index 0cdf24af4..dff0e41cc 100644
--- a/client/src/app/[site]/globe/page.tsx
+++ b/client/src/app/[site]/globe/page.tsx
@@ -4,7 +4,7 @@ import "mapbox-gl/dist/mapbox-gl.css";
import { useEffect, useRef } from "react";
import "./globe.css";
-import { VisuallyHidden } from "radix-ui";
+import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
import { DisabledOverlay } from "../../../components/DisabledOverlay";
import { SessionCard } from "../../../components/Sessions/SessionCard";
import { Dialog, DialogContent, DialogTitle } from "../../../components/ui/dialog";
@@ -137,9 +137,9 @@ export default function GlobePage() {
</div>
<Dialog open={!!selectedSession} onOpenChange={open => !open && setSelectedSession(null)}>
- <VisuallyHidden.Root>
+ <VisuallyHidden>
<DialogTitle>Session Details</DialogTitle>
- </VisuallyHidden.Root>
+ </VisuallyHidden>
<DialogContent className="max-w-4xl max-h-[80vh] overflow-y-auto bg-transparent border-0 p-0 shadow-none [&>button]:hidden">
{selectedSession && <SessionCard session={selectedSession} expandedByDefault />}
</DialogContent>
diff --git a/client/src/app/[site]/realtime/RealtimeChart/RealtimeChart.tsx b/client/src/app/[site]/realtime/RealtimeChart/RealtimeChart.tsx
deleted file mode 100644
index 2ea8c4893..000000000
--- a/client/src/app/[site]/realtime/RealtimeChart/RealtimeChart.tsx
+++ /dev/null
@@ -1,83 +0,0 @@
-import { ResponsiveBar } from "@nivo/bar";
-import { DateTime } from "luxon";
-import { useMemo } from "react";
-import { useGetOverviewBucketed } from "../../../../api/analytics/useGetOverviewBucketed";
-import { nivoTheme } from "../../../../lib/nivo";
-import { useStore } from "../../../../lib/store";
-
-export function RealtimeChart() {
- const { site } = useStore();
-
- // Create a time object for the last 30 minutes for realtime data
- const realtimeTime = {
- mode: "past-minutes" as const,
- pastMinutesStart: 30,
- pastMinutesEnd: 0,
- };
-
- const { data, isLoading } = useGetOverviewBucketed({
- site,
- bucket: "minute",
- overrideTime: realtimeTime,
- refetchInterval: 10000,
- });
-
- const chartData = useMemo(() => {
- if (!data?.data || data.data.length === 0) {
- return [];
- }
-
- return data.data.map(point => ({
- time: DateTime.fromSQL(point.time).toUTC().toFormat("yyyy-MM-dd HH:mm:ss"),
- users: point.users,
- }));
- }, [data]);
-
- if (isLoading) {
- return null;
- }
-
- if (!chartData || chartData.length === 0) {
- return null;
- }
-
- return (
- <ResponsiveBar
- data={chartData}
- keys={["users"]}
- indexBy="time"
- margin={{ top: 0, right: 0, bottom: 12, left: 0 }}
- padding={0.3}
- valueScale={{ type: "linear" }}
- indexScale={{ type: "band", round: true }}
- colors={["hsl(var(--amber-200))"]}
- theme={nivoTheme}
- axisTop={null}
- axisRight={null}
- axisBottom={null}
- axisLeft={null}
- enableLabel={false}
- enableGridX={false}
- enableGridY={false}
- tooltip={({ id, value, data }: { id: string | number; value: number; data: { time: string; users: number } }) => {
- const currentTime = DateTime.fromFormat(data.time, "yyyy-MM-dd HH:mm:ss", { zone: "utc" }).toLocal();
- const currentY = Number(value);
-
- return (
- <div className="bg-neutral-950 p-2 rounded-md text-xs">
- <div className="font-semibold mb-1">
- {currentTime.isValid ? currentTime.toFormat("h:mm") : "Invalid Time"}
- </div>
- <div className="flex justify-between items-center">
- <span className="font-medium">{currentY.toLocaleString()}</span>
- <span className="text-muted-foreground ml-1">{id}</span>
- </div>
- </div>
- );
- }}
- animate={true}
- motionConfig="gentle"
- borderRadius={2}
- />
- );
-}
diff --git a/client/src/app/[site]/realtime/RealtimeEvents/RealtimeEvents.tsx b/client/src/app/[site]/realtime/RealtimeEvents/RealtimeEvents.tsx
deleted file mode 100644
index f9471bca7..000000000
--- a/client/src/app/[site]/realtime/RealtimeEvents/RealtimeEvents.tsx
+++ /dev/null
@@ -1,209 +0,0 @@
-import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
-import { Laptop, Smartphone } from "lucide-react";
-import { DateTime } from "luxon";
-import Link from "next/link";
-import { Event, useGetEvents } from "../../../../api/analytics/events/useGetEvents";
-import { EventIcon, PageviewIcon } from "../../../../components/EventIcons";
-import { Skeleton } from "../../../../components/ui/skeleton";
-import { cn, getCountryName } from "../../../../lib/utils";
-import { Browser } from "../../components/shared/icons/Browser";
-import { CountryFlag } from "../../components/shared/icons/CountryFlag";
-import { OperatingSystem } from "../../components/shared/icons/OperatingSystem";
-
-// DeviceIcon component for displaying mobile/desktop icons
-function DeviceIcon({ deviceType }: { deviceType: string }) {
- const type = deviceType.toLowerCase();
-
- if (type.includes("mobile") || type.includes("tablet")) {
- return <Smartphone className="w-4 h-4" />;
- }
-
- return <Laptop className="w-4 h-4" />;
-}
-
-// Function to truncate path for display
-function truncatePath(path: string, maxLength: number = 31) {
- if (!path) return "-";
- if (path.length <= maxLength) return path;
-
- // Keep the beginning of the path with ellipsis
- return `${path.substring(0, maxLength)}...`;
-}
-
-function EventCard({ event }: { event: Event }) {
- // Parse event timestamp
- const eventTime = DateTime.fromSQL(event.timestamp, {
- zone: "utc",
- }).toLocal();
-
- // Determine if it's a pageview or custom event
- const isPageview = event.type === "pageview";
-
- const fullPath = `https://${event.hostname}${event.pathname}${event.querystring ? `${event.querystring}` : ""}`;
-
- return (
- <Link href={`user/${event.user_id}`} target="_blank" rel="noopener noreferrer">
- <div className="mb-3 rounded-lg bg-neutral-850/50 border border-neutral-800 overflow-hidden p-3 flex flex-col filter backdrop-blur-sm hover:bg-neutral-800/70 transition-all duration-200">
- <div className="flex items-center gap-2 text-sm text-neutral-100 mb-2">
- <div className="flex items-center gap-2">{isPageview ? <PageviewIcon /> : <EventIcon />}</div>
-
- {event.type === "pageview" ? (
- <div>
- <Link href={fullPath} target="_blank" rel="noopener noreferrer">
- <div
- className="text-sm truncate hover:underline "
- title={event.pathname}
- style={{
- maxWidth: "calc(min(100vw, 1150px) - 250px)",
- }}
- >
- {truncatePath(`${event.pathname}${event.querystring ? `${event.querystring}` : ""}`)}
- </div>
- </Link>
- </div>
- ) : (
- <div>{event.event_name}</div>
- )}
- </div>
- <div className="flex items-center gap-2">
- <div className="flex space-x-2 items-center ml-6">
- {event.country && (
- <Tooltip>
- <TooltipTrigger asChild>
- <div className="flex items-center">
- <CountryFlag country={event.country} />
- </div>
- </TooltipTrigger>
- <TooltipContent>
- <p>{getCountryName(event.country)}</p>
- </TooltipContent>
- </Tooltip>
- )}
- <Tooltip>
- <TooltipTrigger asChild>
- <div>
- <Browser browser={event.browser || "Unknown"} />
- </div>
- </TooltipTrigger>
- <TooltipContent>
- <p>{event.browser || "Unknown browser"}</p>
- </TooltipContent>
- </Tooltip>
- <Tooltip>
- <TooltipTrigger asChild>
- <div>
- <OperatingSystem os={event.operating_system || ""} />
- </div>
- </TooltipTrigger>
- <TooltipContent>
- <p>{event.operating_system || "Unknown OS"}</p>
- </TooltipContent>
- </Tooltip>
- <Tooltip>
- <TooltipTrigger asChild>
- <div>
- <DeviceIcon deviceType={event.device_type || ""} />
- </div>
- </TooltipTrigger>
- <TooltipContent>
- <p>{event.device_type || "Unknown device"}</p>
- </TooltipContent>
- </Tooltip>
- </div>
-
- {/* Path with tooltip for long paths */}
- {/* <div className="flex items-center ml-3 flex-1 min-w-0">
- <Tooltip>
- <TooltipTrigger asChild>
- <span className="text-xs text-neutral-400 truncate max-w-[200px] inline-block">
- {truncatePath(
- isPageview && event.page_title
- ? event.page_title
- : event.pathname
- )}
- </span>
- </TooltipTrigger>
- <TooltipContent>
- <p>
- {isPageview && event.page_title
- ? `${event.page_title} (${event.pathname})`
- : event.pathname || "-"}
- </p>
- </TooltipContent>
- </Tooltip>
- </div> */}
-
- {/* Time information */}
- <div className="flex items-center text-xs text-neutral-300">
- <span className="text-neutral-400">{eventTime.toRelative()}</span>
- </div>
- </div>
- </div>
- </Link>
- );
-}
-
-export function RealtimeEvents() {
- const { data, isLoading } = useGetEvents(100);
-
- if (isLoading) {
- return <EventCardSkeleton />;
- }
-
- if (!data || data.length === 0) {
- return <div className="text-sm text-neutral-400 p-4 text-center">No events recorded yet</div>;
- }
-
- return (
- <div className="overflow-y-auto p-2" style={{ height: "100vh" }}>
- {data.map((event: Event, index: number) => (
- <EventCard key={`${event.timestamp}-${index}`} event={event} />
- ))}
- </div>
- );
-}
-
-function EventCardSkeleton() {
- // Function to get a random width class for skeletons
- const getRandomWidth = () => {
- const widths = ["w-16", "w-20", "w-24", "w-28", "w-32", "w-36", "w-40"];
- return widths[Math.floor(Math.random() * widths.length)];
- };
-
- // Create multiple skeletons for a realistic loading state
- const skeletons = Array.from({ length: 5 }).map((_, index) => (
- <div
- className="mb-3 rounded-lg bg-neutral-850/50 border border-neutral-800 overflow-hidden p-3 flex flex-col filter backdrop-blur-sm"
- key={index}
- >
- {/* Title row */}
- <div className="flex items-center gap-2 text-sm text-neutral-100 mb-2">
- <div className="flex items-center gap-2">
- <Skeleton className="h-4 w-4 rounded-sm" />
- </div>
- <Skeleton className={cn("h-4", getRandomWidth())} />
- </div>
-
- {/* Details row */}
- <div className="flex items-center gap-2">
- <div className="flex space-x-2 items-center ml-6">
- <Skeleton className="h-4 w-4 rounded-sm" />
- <Skeleton className="h-4 w-4 rounded-sm" />
- <Skeleton className="h-4 w-4 rounded-sm" />
- <Skeleton className="h-4 w-4 rounded-sm" />
- </div>
-
- {/* Time */}
- <div className="flex items-center text-xs">
- <Skeleton className="h-3 w-16" />
- </div>
- </div>
- </div>
- ));
-
- return (
- <div className="overflow-y-auto p-2" style={{ height: "100vh" }}>
- {skeletons}
- </div>
- );
-}
diff --git a/client/src/app/[site]/realtime/RealtimeGlobe/RealtimeGlobe.tsx b/client/src/app/[site]/realtime/RealtimeGlobe/RealtimeGlobe.tsx
deleted file mode 100644
index 564cd0c4d..000000000
--- a/client/src/app/[site]/realtime/RealtimeGlobe/RealtimeGlobe.tsx
+++ /dev/null
@@ -1,161 +0,0 @@
-"use client";
-
-import { useQuery } from "@tanstack/react-query";
-import { useWindowSize } from "@uidotdev/usehooks";
-import { scaleSequentialSqrt } from "d3-scale";
-import { interpolateYlOrRd } from "d3-scale-chromatic";
-import { memoize, debounce } from "lodash";
-import { useEffect, useMemo, useRef, useState, useCallback } from "react";
-import Globe from "react-globe.gl";
-import { MeshPhongMaterial } from "three";
-import { useGetSessionLocations } from "../../../../api/analytics/useGetSessionLocations";
-import { useAtom } from "jotai";
-import { minutesAtom } from "../realtimeStore";
-
-const randomShader = memoize((e: string) => {
- return `rgba(120, 140, 110, ${Math.random() / 2 + 0.5})`;
-});
-
-export const World = ({ width }: { width: number }) => {
- const globeEl = useRef<any>(null);
- const size = useWindowSize();
-
- const { data: liveSessionLocations, isLoading: isLiveSessionLocationsLoading } = useGetSessionLocations();
-
- const { data: countries = { features: [] } } = useQuery({
- queryKey: ["countries"],
- queryFn: async () => {
- const res = await fetch("/countries.geojson");
- return res.json();
- },
- });
-
- const highest = liveSessionLocations?.reduce((acc, curr) => Math.max(acc, curr.count), 0) ?? 1;
-
- const normalized = 5 / Number(30);
- const weightColor = scaleSequentialSqrt(interpolateYlOrRd).domain([0, highest * normalized * 15]);
-
- useEffect(() => {
- // Auto-rotate
- if (globeEl.current) {
- globeEl.current.controls().autoRotate = true;
- globeEl.current.controls().autoRotateSpeed = 0.2;
- }
- }, [globeEl.current]);
-
- const [hexAltitude, setHexAltitude] = useState(0.001);
-
- // Debounced updateAltitude handler: fires once, 200ms after the last 'end' event
- const updateAltitude = useCallback(
- debounce(() => {
- if (!globeEl.current) return;
-
- const controls = globeEl.current.controls();
- const distance = Math.round(controls.getDistance());
-
- const low = 0.001,
- mid = 0.005,
- high = 0.02;
- const near = 300,
- far = 600;
- const nextAlt = distance <= near ? low : distance >= far ? high : mid;
-
- // set only if changed
- if (nextAlt !== hexAltitude) {
- setHexAltitude(nextAlt);
- }
- }, 200),
- [globeEl, hexAltitude, setHexAltitude]
- );
-
- useEffect(() => {
- if (!globeEl.current) return;
- const controls = globeEl.current.controls();
- // Limit distance maximal distance
- controls.maxDistance = 900;
- // Subscribe on change event
- controls.addEventListener("end", updateAltitude);
- return () => {
- controls.removeEventListener("end", updateAltitude);
- updateAltitude.cancel(); // cancel any pending call
- };
- }, [globeEl, updateAltitude]);
-
- const oceanBlueMaterial = useMemo(
- () =>
- new MeshPhongMaterial({
- color: "hsl(220.9, 30.3%, 16%)",
- transparent: false,
- opacity: 1,
- }),
- []
- );
-
- const liveSessionLocationsData = useMemo(() => {
- return liveSessionLocations?.map(e => ({
- lat: e.lat,
- lng: e.lon,
- count: Math.max(1, e.count / highest),
- }));
- }, [liveSessionLocations]);
-
- const { width: windowWidth } = useWindowSize();
-
- return (
- <div
- onMouseDown={() => {
- if (globeEl.current) {
- globeEl.current.controls().autoRotate = false;
- }
- }}
- >
- <Globe
- onGlobeReady={() => {
- if (globeEl.current) {
- // Set initial view: lat, lng, and altitude (zoom)
- globeEl.current.pointOfView({
- lat: 20,
- lng: -36,
- altitude: windowWidth && windowWidth > 768 ? 2 : 3,
- });
- }
- }}
- ref={globeEl as any}
- width={width ?? 0}
- height={size.height ?? 0}
- globeOffset={[windowWidth && windowWidth > 768 ? -100 : 0, windowWidth && windowWidth > 768 ? 0 : 100]}
- atmosphereColor="rgba(170, 170, 200, 1)"
- globeMaterial={oceanBlueMaterial}
- hexPolygonsData={countries.features}
- hexPolygonResolution={3}
- hexPolygonMargin={0.2}
- hexBinResolution={3}
- hexBinPointsData={liveSessionLocationsData}
- hexPolygonAltitude={hexAltitude}
- hexBinMerge={true}
- hexBinPointWeight={"count"}
- backgroundColor="rgba(0, 0, 0, 0)"
- hexPolygonColor={(e: any) => {
- return randomShader(e.properties.ISO_A2);
- }}
- hexTopColor={d => weightColor(d.sumWeight)}
- hexSideColor={d => weightColor(d.sumWeight)}
- // @ts-ignore
- // hexPolygonLabel={(props: any) => {
- // console.info(props);
- // return <div>{props.properties.ADMIN}</div>;
- // // <div className="text-neutral-100 bg-neutral-900 border border-neutral-700 rounded-md p-2 ">
- // // <div>
- // // <b>
- // // {d.ADMIN} ({d.ISO_A2})
- // // </b>
- // // </div>
- // // <div>
- // // Population: <i>{d.POP_EST}</i>
- // // </div>
- // // </div>
- // }}
- />
- </div>
- );
-};
diff --git a/client/src/app/[site]/realtime/page.tsx b/client/src/app/[site]/realtime/page.tsx
deleted file mode 100644
index 9e4fef0d6..000000000
--- a/client/src/app/[site]/realtime/page.tsx
+++ /dev/null
@@ -1,81 +0,0 @@
-"use client";
-
-import NumberFlow from "@number-flow/react";
-import { useMeasure } from "@uidotdev/usehooks";
-import { useAtom } from "jotai";
-import { useGetLiveUsercount } from "../../../api/analytics/useGetLiveUserCount";
-import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../../../components/ui/select";
-import { useSetPageTitle } from "../../../hooks/useSetPageTitle";
-import { RealtimeChart } from "./RealtimeChart/RealtimeChart";
-import { RealtimeEvents } from "./RealtimeEvents/RealtimeEvents";
-import { World } from "./RealtimeGlobe/RealtimeGlobe";
-import { minutesAtom, MinutesType } from "./realtimeStore";
-import { DisabledOverlay } from "../../../components/DisabledOverlay";
-import { MobileSidebar } from "../components/Sidebar/MobileSidebar";
-
-export default function RealtimePage() {
- useSetPageTitle("Rybbit · Realtime");
- const [ref, { width }] = useMeasure();
-
- const [minutes, setMinutes] = useAtom(minutesAtom);
-
- const { data } = useGetLiveUsercount(Number(minutes));
-
- return (
- <DisabledOverlay message="Realtime" featurePath="realtime">
- <div className="relative overflow-hidden" ref={ref}>
- <World width={width ?? 0} />
-
- <div className="absolute top-2 left-2 md:top-4 md:left-4 flex flex-row gap-2 items-start">
- <MobileSidebar />
- <div className="flex flex-col p-2 md:p-3 bg-neutral-900 rounded-lg shadow-lg border border-neutral-750 w-[300px] md:w-[400px]">
- <div className="p-2">
- <div className="text-sm text-neutral-400 flex gap-2 text-nowrap items-center">
- <div className="flex justify-center">
- <span className="relative flex h-3 w-3">
- <span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-green-400 opacity-75"></span>
- <span className="relative inline-flex h-3 w-3 rounded-full bg-green-500"></span>
- </span>
- </div>
- Visitors in the last{" "}
- <Select value={minutes} onValueChange={value => setMinutes(value as MinutesType)}>
- <SelectTrigger>
- <SelectValue placeholder="Select a time period" />
- </SelectTrigger>
- <SelectContent>
- <SelectItem value="5">5 minutes</SelectItem>
- <SelectItem value="15">15 minutes</SelectItem>
- <SelectItem value="30">30 minutes</SelectItem>
- <SelectItem value="60">1 hour</SelectItem>
- <SelectItem value="120">2 hours</SelectItem>
- <SelectItem value="240">4 hours</SelectItem>
- <SelectItem value="480">8 hours</SelectItem>
- <SelectItem value="720">12 hours</SelectItem>
- <SelectItem value="1440">24 hours</SelectItem>
- </SelectContent>
- </Select>
- </div>
- <div className="text-3xl md:text-5xl font-bold flex items-center gap-2">
- {<NumberFlow respectMotionPreference={false} value={data?.count ?? 0} />}
- </div>
- </div>
- <div className="h-[50px] md:h-[70px]">
- <RealtimeChart />
- </div>
- </div>
- </div>
-
- <div className="hidden md:block absolute top-4 right-4 w-[320px]">
- <RealtimeEvents />
- </div>
-
- {/* <div className="grid grid-cols-1 md:grid-cols-2 gap-4">
- <Pages isRealtime />
- <Events isRealtime />
- <Referrers isRealtime />
- <Countries isRealtime />
- </div> */}
- </div>
- </DisabledOverlay>
- );
-}
diff --git a/client/src/app/[site]/realtime/realtimeStore.ts b/client/src/app/[site]/realtime/realtimeStore.ts
deleted file mode 100644
index 45c0a176d..000000000
--- a/client/src/app/[site]/realtime/realtimeStore.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-import { atom } from "jotai";
-
-export type MinutesType = "5" | "15" | "30" | "60" | "120" | "240" | "480" | "720" | "1440";
-
-export const minutesAtom = atom<MinutesType>("30");
diff --git a/client/src/app/admin/page.tsx b/client/src/app/admin/page.tsx
index ac9a99114..76f2178fc 100644
--- a/client/src/app/admin/page.tsx
+++ b/client/src/app/admin/page.tsx
@@ -15,7 +15,7 @@ import { Button } from "../../components/ui/button";
import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from "../../components/ui/sheet";
import { Menu } from "lucide-react";
-import { VisuallyHidden } from "radix-ui";
+import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
import { Favicon } from "../../components/Favicon";
function MobileSidebar() {
@@ -30,11 +30,11 @@ function MobileSidebar() {
<Menu />
</Button>
</SheetTrigger>
- <VisuallyHidden.Root>
+ <VisuallyHidden>
<SheetHeader>
<SheetTitle>Rybbit Sidebar</SheetTitle>
</SheetHeader>
- </VisuallyHidden.Root>
+ </VisuallyHidden>
<SheetContent side="left" className="p-0 w-[40px] flex gap-0" showClose={false}>
<AppSidebar />
</SheetContent>
diff --git a/client/src/app/components/AddSite.tsx b/client/src/app/components/AddSite.tsx
index f6b7031b8..7b11853c4 100644
--- a/client/src/app/components/AddSite.tsx
+++ b/client/src/app/components/AddSite.tsx
@@ -59,8 +59,6 @@ export function AddSite({ trigger, disabled }: { trigger?: React.ReactNode; disa
const { data: sites, refetch } = useGetSitesFromOrg(activeOrganization?.id);
const { data: subscription } = useStripeSubscription();
- console.info(subscription);
-
const isOverSiteLimit = getSiteLimit(subscription) <= (sites?.sites?.length || 0) && IS_CLOUD;
const finalDisabled = disabled || isOverSiteLimit;
diff --git a/client/src/app/settings/components/MobileSidebar.tsx b/client/src/app/settings/components/MobileSidebar.tsx
index a7726d59d..973dd16b0 100644
--- a/client/src/app/settings/components/MobileSidebar.tsx
+++ b/client/src/app/settings/components/MobileSidebar.tsx
@@ -4,7 +4,7 @@ import { Button } from "../../../components/ui/button";
import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from "../../../components/ui/sheet";
import { Menu } from "lucide-react";
-import { VisuallyHidden } from "radix-ui";
+import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
import { AppSidebar } from "../../../components/AppSidebar";
import { SettingsSidebar } from "./SettingsSidebar";
@@ -17,11 +17,11 @@ export function MobileSidebar() {
<Menu />
</Button>
</SheetTrigger>
- <VisuallyHidden.Root>
+ <VisuallyHidden>
<SheetHeader>
<SheetTitle>Rybbit Sidebar</SheetTitle>
</SheetHeader>
- </VisuallyHidden.Root>
+ </VisuallyHidden>
<SheetContent side="left" className="p-0 w-[240px] flex gap-0" showClose={false}>
<AppSidebar />
<SettingsSidebar />
diff --git a/client/src/app/uptime/monitors/components/Sidebar/MobileSidebar.tsx b/client/src/app/uptime/monitors/components/Sidebar/MobileSidebar.tsx
index 4bffe90f5..12f61a4df 100644
--- a/client/src/app/uptime/monitors/components/Sidebar/MobileSidebar.tsx
+++ b/client/src/app/uptime/monitors/components/Sidebar/MobileSidebar.tsx
@@ -3,7 +3,7 @@
import { UptimeSidebar } from "./UptimeSidebar";
import { Menu } from "lucide-react";
-import { VisuallyHidden } from "radix-ui";
+import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
import { AppSidebar } from "../../../../../components/AppSidebar";
import { Button } from "../../../../../components/ui/button";
import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from "../../../../../components/ui/sheet";
@@ -17,11 +17,11 @@ export function MobileSidebar() {
<Menu />
</Button>
</SheetTrigger>
- <VisuallyHidden.Root>
+ <VisuallyHidden>
<SheetHeader>
<SheetTitle>Rybbit Sidebar</SheetTitle>
</SheetHeader>
- </VisuallyHidden.Root>
+ </VisuallyHidden>
<SheetContent side="left" className="p-0 w-[240px] flex gap-0" showClose={false}>
<AppSidebar />
<UptimeSidebar />
diff --git a/client/src/components/SiteSettings/SiteConfiguration.tsx b/client/src/components/SiteSettings/SiteConfiguration.tsx
index c367dbbf1..a137acfd2 100644
--- a/client/src/components/SiteSettings/SiteConfiguration.tsx
+++ b/client/src/components/SiteSettings/SiteConfiguration.tsx
@@ -179,7 +179,7 @@ export function SiteConfiguration({ siteMetadata, disabled = false, onClose }: S
},
];
- const { data: subscription } = useStripeSubscription();
+ const { data: subscription, isLoading: isSubscriptionLoading } = useStripeSubscription();
const sessionReplayDisabled = !subscription?.isPro && IS_CLOUD;
const webVitalsDisabled = subscription?.status !== "active" && IS_CLOUD;
@@ -187,17 +187,21 @@ export function SiteConfiguration({ siteMetadata, disabled = false, onClose }: S
// Configuration for analytics feature toggles
const analyticsToggles: ToggleConfig[] = [
- {
- id: "sessionReplay",
- label: "Session Replay",
- description: "Record and replay user sessions to understand user behavior",
- value: toggleStates.sessionReplay,
- key: "sessionReplay",
- enabledMessage: "Session replay enabled",
- disabledMessage: "Session replay disabled",
- disabled: sessionReplayDisabled,
- badge: <Badge variant="success">Pro</Badge>,
- },
+ ...(!subscription?.planName?.startsWith("appsumo") && !isSubscriptionLoading
+ ? [
+ {
+ id: "sessionReplay",
+ label: "Session Replay",
+ description: "Record and replay user sessions to understand user behavior",
+ value: toggleStates.sessionReplay,
+ key: "sessionReplay",
+ enabledMessage: "Session replay enabled",
+ disabledMessage: "Session replay disabled",
+ disabled: sessionReplayDisabled,
+ badge: <Badge variant="success">Pro</Badge>,
+ } as ToggleConfig,
+ ]
+ : []),
...(IS_CLOUD
? [
{