Session Replay Demo
This guide walks through instrumenting a web application for session replay using the ClickStack Browser SDK. Unlike other sample datasets that load pre-generated data, this demo provides an interactive application where you generate session data through your own interactions.
Time required: 10-15 minutes
Overview
The session replay demo application is a documentation explorer built with vanilla JavaScript. It demonstrates how minimal session replay instrumentation can be — one script tag and one initialization call captures all user interactions automatically.
The repository includes two branches:
main— fully instrumented and ready to use immediatelypre-instrumented— a clean version without instrumentation, with code comments indicating where to add it
This guide uses the main branch first to see session replay in action, then walks through the instrumentation code so you can apply the same pattern to your own application.
For background on what session replay is and how it fits into ClickStack, see the Session Replay feature page.
Prerequisites
- Docker and Docker Compose installed
- Ports 3000, 4317, 4318, and 8080 available
Running the demo
Clone the repository
Start ClickStack
Get your API key
- Open HyperDX at http://localhost:8080
- Create an account or log in if needed
- Navigate to Team Settings → API Keys
- Copy your Ingestion API Key
- Set it as an environment variable:
Start the demo application
Ensure you run this command in the same terminal where you exported the CLICKSTACK_API_KEY variable.
Open http://localhost:3000 in your browser and interact with the app — search for topics, filter by category, view code examples, and bookmark items.
All interactions are automatically captured by the ClickStack Browser SDK.
View your session replay
Return to HyperDX at http://localhost:8080 and navigate to Client Sessions from the left sidebar.
You should see your session listed with its duration and event count. Click the ▶️ button to replay it.
Switch between Highlighted and All Events modes to adjust the level of detail on the timeline.
The instrumentation
The demo application shows how little code is needed to enable session replay. Two additions to the application are all it takes:
1. Include the SDK (app/public/index.html):
2. Initialize ClickStack (app/public/js/app.js):
Everything else is standard application code. The SDK automatically captures all user interactions, console logs, network requests, and errors — no additional instrumentation is needed.
Try it yourself
To instrument the app from scratch, switch to the pre-instrumented branch:
This branch contains the same application without any ClickStack instrumentation. Code comments in app/public/index.html and app/public/js/app.js indicate exactly where to add the two code snippets above. Once added, restart the demo app and your interactions will begin appearing in ClickStack.
Troubleshooting
Sessions not appearing in HyperDX
- Check the browser console for errors
- Verify ClickStack is running:
docker-compose ps - Confirm the API key is set:
echo $CLICKSTACK_API_KEY - Adjust the time range in the Client Sessions view (try Last 15 minutes)
- Hard refresh the browser:
Cmd+Shift+R(Mac) orCtrl+Shift+R(Windows/Linux)
401 Unauthorized errors
The API key isn't set correctly. Make sure you:
- Exported it in your terminal:
export CLICKSTACK_API_KEY='your-key' - Started the demo app in the same terminal where you exported it
- Got the key from the HyperDX UI (not a randomly generated string)
Cleanup
Stop the services:
Remove all data:
Learn more
- Session Replay — feature overview, SDK options, and privacy controls
- Browser SDK Reference — full SDK options and advanced configuration
- ClickStack Getting Started — deploy ClickStack and ingest your first data
- All Sample Datasets — other example datasets and guides