Skip to content

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

Enhance session details and UI components for improved user experience

Bill Yange8867985d0b0
diff --git a/client/src/api/analytics/userSessions.ts b/client/src/api/analytics/userSessions.ts
index 23231c964..38b77494f 100644
--- a/client/src/api/analytics/userSessions.ts
+++ b/client/src/api/analytics/userSessions.ts
@@ -90,3 +90,57 @@ export function useGetSessionsInfinite() {
staleTime: Infinity,
});
}
+
+export interface SessionDetails {
+ session_id: string;
+ user_id: string;
+ country: string;
+ iso_3166_2: string;
+ language: string;
+ device_type: string;
+ browser: string;
+ browser_version: string;
+ operating_system: string;
+ operating_system_version: string;
+ screen_width: number;
+ screen_height: number;
+ referrer: string;
+ session_end: string;
+ session_start: string;
+ pageviews: number;
+ entry_page: string;
+ exit_page: string;
+}
+
+export interface PageviewEvent {
+ timestamp: string;
+ pathname: string;
+ querystring: string;
+ page_title: string;
+ referrer: string;
+ type: string;
+ event_name?: string;
+ properties?: string;
+}
+
+export interface SessionPageviewsAndEvents {
+ session: SessionDetails;
+ pageviews: PageviewEvent[];
+}
+
+export function useGetSessionDetails(sessionId: string | null) {
+ const { site } = useStore();
+
+ return useQuery<APIResponse<SessionPageviewsAndEvents>>({
+ queryKey: ["session-details", sessionId, site],
+ queryFn: () => {
+ if (!sessionId) throw new Error("Session ID is required");
+
+ return authedFetch(`${BACKEND_URL}/session/${sessionId}`, {
+ site,
+ }).then((res) => res.json());
+ },
+ enabled: !!sessionId && !!site,
+ staleTime: Infinity,
+ });
+}
diff --git a/client/src/app/[site]/sessions/components/SessionCard.tsx b/client/src/app/[site]/sessions/components/SessionCard.tsx
index 750aea4a3..bbb85792c 100644
--- a/client/src/app/[site]/sessions/components/SessionCard.tsx
+++ b/client/src/app/[site]/sessions/components/SessionCard.tsx
@@ -1,6 +1,5 @@
import { useState } from "react";
import { DateTime } from "luxon";
-import { useRouter } from "next/navigation";
import { Browser } from "../../components/shared/icons/Browser";
import { CountryFlag } from "../../components/shared/icons/CountryFlag";
import { OperatingSystem } from "../../components/shared/icons/OperatingSystem";
@@ -12,9 +11,19 @@ import {
ChevronRight,
ArrowRight,
Clock,
+ Globe,
+ MonitorSmartphone,
+ Code,
+ FileText,
+ MousePointerClick,
+ ExternalLink,
} from "lucide-react";
import Avatar from "boring-avatars";
-import { GetSessionsResponse } from "../../../../api/analytics/userSessions";
+import {
+ GetSessionsResponse,
+ useGetSessionDetails,
+ PageviewEvent,
+} from "../../../../api/analytics/userSessions";
import { Skeleton } from "@/components/ui/skeleton";
import {
Tooltip,
@@ -22,6 +31,9 @@ import {
TooltipProvider,
TooltipTrigger,
} from "@/components/ui/tooltip";
+import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
+import { Badge } from "@/components/ui/badge";
+import { Alert, AlertDescription } from "@/components/ui/alert";
interface SessionCardProps {
session: GetSessionsResponse[number];
@@ -48,9 +60,44 @@ function truncatePath(path: string, maxLength: number = 32) {
return `${path.substring(0, maxLength)}...`;
}
+// Component to display a single pageview or event
+function PageviewItem({ item, index }: { item: PageviewEvent; index: number }) {
+ const isEvent = item.type !== "pageview";
+ const timestamp = DateTime.fromSQL(item.timestamp);
+ const formattedTime = timestamp.toFormat("h:mm:ss a");
+
+ return (
+ <div className="flex items-center gap-3 py-2 border-b border-neutral-700 last:border-0">
+ <div className="text-sm text-gray-500 min-w-8 text-right">
+ {index + 1}.
+ </div>
+ <div className="flex-shrink-0">
+ {isEvent ? (
+ <MousePointerClick className="w-4 h-4 text-amber-500" />
+ ) : (
+ <FileText className="w-4 h-4 text-blue-500" />
+ )}
+ </div>
+ <div className="flex flex-1 items-center justify-between">
+ <span className="text-sm truncate max-w-[500px]" title={item.pathname}>
+ {item.pathname}
+ {item.querystring && `?${item.querystring}`}
+ </span>
+ <span className="text-xs text-gray-500 flex-shrink-0">
+ {formattedTime}
+ </span>
+ </div>
+ </div>
+ );
+}
+
export function SessionCard({ session, onClick }: SessionCardProps) {
const [expanded, setExpanded] = useState(false);
- const router = useRouter();
+ const {
+ data: sessionDetails,
+ isLoading,
+ error,
+ } = useGetSessionDetails(expanded ? session.session_id : null);
// Calculate session duration in minutes
const start = DateTime.fromSQL(session.session_start);
@@ -72,30 +119,27 @@ export function SessionCard({ session, onClick }: SessionCardProps) {
};
return (
- <div
- className="mb-3 rounded-lg bg-neutral-900 border border-neutral-800 overflow-hidden"
- onClick={handleCardClick}
- >
- <div className="p-3 cursor-pointer">
- <div className="flex items-center gap-2">
- {/* Avatar and User ID */}
+ <div className="mb-3 rounded-lg bg-neutral-900 border border-neutral-800 overflow-hidden">
+ <TooltipProvider>
+ <div className="p-3 cursor-pointer" onClick={handleCardClick}>
<div className="flex items-center gap-2">
- <Avatar
- name={session.user_id}
- colors={["#2c2b4b", "#a75293", "#9c7a9d", "#9ddacb", "#f8dcb4"]}
- variant="beam"
- size={24}
- />
- <span className="text-xs font-mono text-gray-400">
- {truncatedUserId}
- </span>
- </div>
+ {/* Avatar and User ID */}
+ <div className="flex items-center gap-2">
+ <Avatar
+ name={session.user_id}
+ colors={["#2c2b4b", "#a75293", "#9c7a9d", "#9ddacb", "#f8dcb4"]}
+ variant="beam"
+ size={24}
+ />
+ <span className="text-xs font-mono text-gray-400">
+ {truncatedUserId}
+ </span>
+ </div>
- {/* Icons section */}
- <div className="flex space-x-2 items-center ml-3">
- {/* Country */}
- {session.country && (
- <TooltipProvider>
+ {/* Icons section */}
+ <div className="flex space-x-2 items-center ml-3">
+ {/* Country */}
+ {session.country && (
<Tooltip>
<TooltipTrigger asChild>
<div className="flex items-center">
@@ -106,11 +150,9 @@ export function SessionCard({ session, onClick }: SessionCardProps) {
<p>{getCountryName(session.country)}</p>
</TooltipContent>
</Tooltip>
- </TooltipProvider>
- )}
+ )}
- {/* Browser */}
- <TooltipProvider>
+ {/* Browser */}
<Tooltip>
<TooltipTrigger asChild>
<div>
@@ -121,10 +163,8 @@ export function SessionCard({ session, onClick }: SessionCardProps) {
<p>{session.browser || "Unknown browser"}</p>
</TooltipContent>
</Tooltip>
- </TooltipProvider>
- {/* OS */}
- <TooltipProvider>
+ {/* OS */}
<Tooltip>
<TooltipTrigger asChild>
<div>
@@ -135,10 +175,8 @@ export function SessionCard({ session, onClick }: SessionCardProps) {
<p>{session.operating_system || "Unknown OS"}</p>
</TooltipContent>
</Tooltip>
- </TooltipProvider>
- {/* Device Type */}
- <TooltipProvider>
+ {/* Device Type */}
<Tooltip>
<TooltipTrigger asChild>
<div>
@@ -149,12 +187,10 @@ export function SessionCard({ session, onClick }: SessionCardProps) {
<p>{session.device_type || "Unknown device"}</p>
</TooltipContent>
</Tooltip>
- </TooltipProvider>
- </div>
+ </div>
- {/* Pages section with tooltips for long paths */}
- <div className="flex items-center ml-3 flex-1 min-w-0">
- <TooltipProvider>
+ {/* Pages section with tooltips for long paths */}
+ <div className="flex items-center ml-3 flex-1 min-w-0">
<Tooltip>
<TooltipTrigger asChild>
<span className="text-xs text-gray-400 truncate max-w-[200px] inline-block">
@@ -165,11 +201,9 @@ export function SessionCard({ session, onClick }: SessionCardProps) {
<p>{session.entry_page || "-"}</p>
</TooltipContent>
</Tooltip>
- </TooltipProvider>
- <ArrowRight className="mx-2 w-3 h-3 flex-shrink-0 text-gray-400" />
+ <ArrowRight className="mx-2 w-3 h-3 flex-shrink-0 text-gray-400" />
- <TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<span className="text-xs text-gray-400 truncate max-w-[200px] inline-block">
@@ -180,12 +214,10 @@ export function SessionCard({ session, onClick }: SessionCardProps) {
<p>{session.exit_page || "-"}</p>
</TooltipContent>
</Tooltip>
- </TooltipProvider>
- </div>
+ </div>
- {/* Time information */}
- <div className="flex items-center gap-2 ml-3">
- <TooltipProvider>
+ {/* Time information */}
+ <div className="flex items-center gap-2 ml-3">
<Tooltip>
<TooltipTrigger asChild>
<div className="flex items-center gap-1 text-xs text-gray-400">
@@ -201,24 +233,240 @@ export function SessionCard({ session, onClick }: SessionCardProps) {
</p>
</TooltipContent>
</Tooltip>
- </TooltipProvider>
- </div>
+ </div>
- {/* Expand/Collapse icon */}
- <div className="ml-3 flex-shrink-0">
- {expanded ? (
- <ChevronDown className="w-4 h-4 text-gray-400" />
- ) : (
- <ChevronRight className="w-4 h-4 text-gray-400" />
- )}
+ {/* Expand/Collapse icon */}
+ <div className="ml-3 flex-shrink-0">
+ {expanded ? (
+ <ChevronDown className="w-4 h-4 text-gray-400" />
+ ) : (
+ <ChevronRight className="w-4 h-4 text-gray-400" />
+ )}
+ </div>
</div>
</div>
- </div>
+ </TooltipProvider>
- {/* Expanded content - to be implemented later */}
+ {/* Expanded content - detailed session data */}
{expanded && (
- <div className="px-4 pb-4 bg-neutral-850 border-t border-neutral-800">
- {/* This will be implemented later */}
+ <div className="px-4 pb-4 bg-neutral-900 border-t border-neutral-700">
+ {isLoading ? (
+ <div className="py-4">
+ <Skeleton className="h-4 w-full mb-2" />
+ <Skeleton className="h-4 w-3/4 mb-2" />
+ <Skeleton className="h-4 w-1/2" />
+ </div>
+ ) : error ? (
+ <Alert variant="destructive" className="mt-4">
+ <AlertDescription>
+ Error loading session details. Please try again.
+ </AlertDescription>
+ </Alert>
+ ) : sessionDetails?.data ? (
+ <Tabs defaultValue="timeline" className="mt-4">
+ <TabsList className="bg-neutral-800">
+ <TabsTrigger value="timeline">Timeline</TabsTrigger>
+ <TabsTrigger value="info">Session Info</TabsTrigger>
+ </TabsList>
+
+ <TabsContent value="timeline" className="mt-4">
+ <div className="mb-3">
+ <div className="text-sm font-medium mb-2">
+ Session Timeline
+ </div>
+ <div className="flex gap-2 mb-3">
+ <Badge
+ variant="outline"
+ className="flex items-center gap-1 bg-neutral-800 text-gray-300"
+ >
+ <FileText className="w-3 h-3" />
+ <span>
+ Pageviews: {sessionDetails.data.session.pageviews}
+ </span>
+ </Badge>
+ <Badge
+ variant="outline"
+ className="flex items-center gap-1 bg-neutral-800 text-gray-300"
+ >
+ <MousePointerClick className="w-3 h-3" />
+ <span>
+ Events:{" "}
+ {
+ sessionDetails.data.pageviews.filter(
+ (p) => p.type !== "pageview"
+ ).length
+ }
+ </span>
+ </Badge>
+ </div>
+ <div className="bg-neutral-950 rounded-md border border-neutral-700 p-2">
+ {sessionDetails.data.pageviews.map((pageview, index) => (
+ <PageviewItem
+ key={`${pageview.timestamp}-${index}`}
+ item={pageview}
+ index={index}
+ />
+ ))}
+ </div>
+ </div>
+ </TabsContent>
+
+ <TabsContent value="info" className="mt-4">
+ <TooltipProvider>
+ <div className="grid grid-cols-2 gap-4 mb-6">
+ <div>
+ <h4 className="text-sm font-medium mb-2">
+ User Information
+ </h4>
+ <div className="space-y-2 bg-neutral-950 p-3 rounded-md border border-neutral-700">
+ <div className="flex items-center gap-2">
+ <Avatar
+ name={sessionDetails.data.session.user_id}
+ colors={[
+ "#2c2b4b",
+ "#a75293",
+ "#9c7a9d",
+ "#9ddacb",
+ "#f8dcb4",
+ ]}
+ variant="beam"
+ size={24}
+ />
+ <div className="text-sm font-mono">
+ {sessionDetails.data.session.user_id}
+ </div>
+ </div>
+ {sessionDetails.data.session.language && (
+ <div className="text-sm text-gray-400">
+ <span className="font-medium">Language:</span>{" "}
+ {sessionDetails.data.session.language}
+ </div>
+ )}
+ {sessionDetails.data.session.country && (
+ <div className="flex items-center gap-2 text-sm text-gray-400">
+ <span className="font-medium">Location:</span>
+ <div className="flex items-center gap-1">
+ <CountryFlag
+ country={sessionDetails.data.session.country}
+ />
+ <span>
+ {getCountryName(
+ sessionDetails.data.session.country
+ )}
+ </span>
+ {sessionDetails.data.session.iso_3166_2 && (
+ <span>
+ ({sessionDetails.data.session.iso_3166_2})
+ </span>
+ )}
+ </div>
+ </div>
+ )}
+ </div>
+ </div>
+
+ <div>
+ <h4 className="text-sm font-medium mb-2">
+ Device Information
+ </h4>
+ <div className="space-y-2 bg-neutral-950 p-3 rounded-md border border-neutral-700">
+ <div className="flex items-center gap-2 text-sm">
+ <MonitorSmartphone className="w-4 h-4" />
+ <span className="font-medium">Device Type:</span>{" "}
+ {sessionDetails.data.session.device_type || "Unknown"}
+ </div>
+
+ <div className="flex items-center gap-2 text-sm">
+ <Browser
+ browser={
+ sessionDetails.data.session.browser || "Unknown"
+ }
+ />
+ <span className="font-medium">Browser:</span>{" "}
+ {sessionDetails.data.session.browser || "Unknown"}
+ {sessionDetails.data.session.browser_version && (
+ <span className="text-gray-400">
+ ({sessionDetails.data.session.browser_version})
+ </span>
+ )}
+ </div>
+
+ <div className="flex items-center gap-2 text-sm">
+ <OperatingSystem
+ os={
+ sessionDetails.data.session.operating_system || ""
+ }
+ />
+ <span className="font-medium">OS:</span>{" "}
+ {sessionDetails.data.session.operating_system ||
+ "Unknown"}
+ {sessionDetails.data.session
+ .operating_system_version && (
+ <span className="text-gray-400">
+ (
+ {
+ sessionDetails.data.session
+ .operating_system_version
+ }
+ )
+ </span>
+ )}
+ </div>
+
+ {sessionDetails.data.session.screen_width &&
+ sessionDetails.data.session.screen_height ? (
+ <div className="text-sm text-gray-400">
+ <span className="font-medium">Screen:</span>{" "}
+ {sessionDetails.data.session.screen_width} x{" "}
+ {sessionDetails.data.session.screen_height}
+ </div>
+ ) : null}
+ </div>
+ </div>
+
+ <div className="col-span-2">
+ <h4 className="text-sm font-medium mb-2">
+ Session Information
+ </h4>
+ <div className="space-y-2 bg-neutral-950 p-3 rounded-md border border-neutral-700">
+ <div className="text-sm">
+ <span className="font-medium">Duration:</span>{" "}
+ {durationFormatted}
+ </div>
+
+ <div className="text-sm">
+ <span className="font-medium">Start Time:</span>{" "}
+ {DateTime.fromSQL(
+ sessionDetails.data.session.session_start
+ ).toFormat("MMMM d, yyyy h:mm:ss a")}
+ </div>
+
+ <div className="text-sm">
+ <span className="font-medium">End Time:</span>{" "}
+ {DateTime.fromSQL(
+ sessionDetails.data.session.session_end
+ ).toFormat("MMMM d, yyyy h:mm:ss a")}
+ </div>
+
+ {sessionDetails.data.session.referrer && (
+ <div className="text-sm">
+ <span className="font-medium">Referrer:</span>
+ <span className="text-gray-400 ml-1 break-all">
+ {sessionDetails.data.session.referrer}
+ </span>
+ </div>
+ )}
+ </div>
+ </div>
+ </div>
+ </TooltipProvider>
+ </TabsContent>
+ </Tabs>
+ ) : (
+ <div className="py-4 text-center text-gray-400">
+ No data available
+ </div>
+ )}
</div>
)}
</div>
diff --git a/client/src/app/[site]/sessions/components/SessionsList.tsx b/client/src/app/[site]/sessions/components/SessionsList.tsx
index 47f7a7003..3027db4fa 100644
--- a/client/src/app/[site]/sessions/components/SessionsList.tsx
+++ b/client/src/app/[site]/sessions/components/SessionsList.tsx
@@ -1,5 +1,5 @@
import { useEffect, useRef } from "react";
-import { useParams, useRouter } from "next/navigation";
+import { useParams } from "next/navigation";
import { GetSessionsResponse } from "../../../../api/analytics/userSessions";
import { SessionCard, SessionCardSkeleton } from "./SessionCard";
@@ -19,16 +19,10 @@ export default function SessionsList({
isFetchingNextPage,
}: SessionsListProps) {
const { site } = useParams();
- const router = useRouter();
// Reference for the scroll container
const containerRef = useRef<HTMLDivElement>(null);
- // Handle navigation to user details page
- const handleSessionClick = (userId: string) => {
- router.push(`/${site}/user/${userId}`);
- };
-
// Infinite scroll implementation
useEffect(() => {
const handleScroll = () => {
@@ -73,11 +67,7 @@ export default function SessionsList({
) : (
// Render session cards with more robust key generation
data.map((session, index) => (
- <SessionCard
- key={`${index}`}
- session={session}
- onClick={() => handleSessionClick(session.user_id)}
- />
+ <SessionCard key={index} session={session} />
))
)}
diff --git a/client/src/app/globals.css b/client/src/app/globals.css
index 7a90826b7..0158a3702 100644
--- a/client/src/app/globals.css
+++ b/client/src/app/globals.css
@@ -357,4 +357,56 @@ body {
--input: 240 3.7% 15.9%;
--ring: 240 4.9% 83.9%;
}
+
+ /* Dark scrollbar styles */
+ /* For Webkit browsers (Chrome, Safari, newer Edge) */
+ ::-webkit-scrollbar {
+ width: 10px;
+ height: 10px;
+ }
+
+ ::-webkit-scrollbar-track {
+ background: hsl(0 0% 9%);
+ border-radius: 4px;
+ }
+
+ ::-webkit-scrollbar-thumb {
+ background: hsl(0 0% 35%);
+ border-radius: 4px;
+ }
+
+ ::-webkit-scrollbar-thumb:hover {
+ background: hsl(0 0% 40%);
+ }
+
+ /* For Firefox */
+ * {
+ scrollbar-width: thin;
+ scrollbar-color: hsl(0 0% 35%) hsl(0 0% 9%);
+ }
+
+ /* Custom scrollbar class for specific elements */
+ .scrollbar-dark::-webkit-scrollbar {
+ width: 8px;
+ height: 8px;
+ }
+
+ .scrollbar-dark::-webkit-scrollbar-track {
+ background: hsl(0 0% 7%);
+ border-radius: 3px;
+ }
+
+ .scrollbar-dark::-webkit-scrollbar-thumb {
+ background: hsl(0 0% 40%);
+ border-radius: 3px;
+ }
+
+ .scrollbar-dark::-webkit-scrollbar-thumb:hover {
+ background: hsl(0 0% 45%);
+ }
+
+ .scrollbar-dark {
+ scrollbar-width: thin;
+ scrollbar-color: hsl(0 0% 40%) hsl(0 0% 7%);
+ }
}
diff --git a/server/src/api/getSession.ts b/server/src/api/getSession.ts
new file mode 100644
index 000000000..69b5bec3b
--- /dev/null
+++ b/server/src/api/getSession.ts
@@ -0,0 +1,146 @@
+import { FastifyReply, FastifyRequest } from "fastify";
+import clickhouse from "../db/clickhouse/clickhouse.js";
+import {
+ getFilterStatement,
+ getTimeStatement,
+ processResults,
+} from "./utils.js";
+import { getUserHasAccessToSite } from "../lib/auth-utils.js";
+
+export interface SessionDetails {
+ session_id: string;
+ user_id: string;
+ country: string;
+ iso_3166_2: string;
+ language: string;
+ device_type: string;
+ browser: string;
+ browser_version: string;
+ operating_system: string;
+ operating_system_version: string;
+ screen_width: number;
+ screen_height: number;
+ referrer: string;
+ session_end: string;
+ session_start: string;
+ pageviews: number;
+ entry_page: string;
+ exit_page: string;
+}
+
+export interface PageviewEvent {
+ timestamp: string;
+ pathname: string;
+ querystring: string;
+ page_title: string;
+ referrer: string;
+ type: string;
+ event_name?: string;
+ properties?: string;
+}
+
+export interface SessionPageviewsAndEvents {
+ session: SessionDetails;
+ pageviews: PageviewEvent[];
+}
+
+export interface GetSessionRequest {
+ Params: {
+ sessionId: string;
+ };
+ Querystring: {
+ site: string;
+ };
+}
+
+export async function getSession(
+ req: FastifyRequest<GetSessionRequest>,
+ res: FastifyReply
+) {
+ const { sessionId } = req.params;
+ const { site } = req.query;
+
+ const userHasAccessToSite = await getUserHasAccessToSite(req, site);
+ if (!userHasAccessToSite) {
+ return res.status(403).send({ error: "Forbidden" });
+ }
+
+ try {
+ // 1. First query: Get session data
+ const sessionQuery = `
+SELECT
+ session_id,
+ user_id,
+ country,
+ iso_3166_2,
+ language,
+ device_type,
+ browser,
+ browser_version,
+ operating_system,
+ operating_system_version,
+ screen_width,
+ screen_height,
+ referrer,
+ session_end,
+ session_start,
+ pageviews,
+ entry_page,
+ exit_page
+FROM sessions
+WHERE
+ site_id = ${site}
+ AND session_id = '${sessionId}'
+LIMIT 1
+ `;
+
+ // 2. Second query: Get all pageviews and events for this session
+ const pageviewsQuery = `
+SELECT
+ timestamp,
+ pathname,
+ querystring,
+ page_title,
+ referrer,
+ type,
+ event_name,
+ properties
+FROM pageviews
+WHERE
+ site_id = ${site}
+ AND session_id = '${sessionId}'
+ORDER BY timestamp ASC
+ `;
+
+ // Execute both queries
+ const sessionResult = await clickhouse.query({
+ query: sessionQuery,
+ format: "JSONEachRow",
+ });
+
+ const pageviewsResult = await clickhouse.query({
+ query: pageviewsQuery,
+ format: "JSONEachRow",
+ });
+
+ const sessionData = await processResults<SessionDetails>(sessionResult);
+ const pageviewsData = await processResults<PageviewEvent>(pageviewsResult);
+
+ if (!sessionData || sessionData.length === 0) {
+ return res.status(404).send({ error: "Session not found" });
+ }
+
+ // Combine both results
+ const response: SessionPageviewsAndEvents = {
+ session: sessionData[0],
+ pageviews: pageviewsData,
+ };
+
+ return res.send({ data: response });
+ } catch (error) {
+ console.error("Error fetching session data:", error);
+ return res.status(500).send({ error: "Failed to fetch session data" });
+ }
+}
+
+export default { getSession };
diff --git a/server/src/index.ts b/server/src/index.ts
index 4a42e9428..c5e8d1fcc 100644
--- a/server/src/index.ts
+++ b/server/src/index.ts
@@ -11,6 +11,7 @@ import { getLiveUsercount } from "./api/getLiveUsercount.js";
import { getOverview } from "./api/getOverview.js";
import { getOverviewBucketed } from "./api/getOverviewBucketed.js";
import { getSessions } from "./api/getSessions.js";
+import { getSession } from "./api/getSession.js";
import { getSingleCol } from "./api/getSingleCol.js";
import { getUserSessions } from "./api/getUserSessions.js";
import { listUsers } from "./api/listUsers.js";
@@ -126,6 +127,7 @@ server.get("/overview-bucketed", getOverviewBucketed);
server.get("/single-col", getSingleCol);
server.get("/site-has-data/:site", getSiteHasData);
server.get("/sessions", getSessions);
+server.get("/session/:sessionId", getSession);
server.get("/user/:userId/sessions", getUserSessions);
// Administrative