Session Recording
Your on-premise instance can record Sessions and render them to MP4, with the video files never leaving your infrastructure. For recording to work you need:
- The session recording feature on your plan. It's embedded in your license key, so if you just added it, re-download the license key (or use the URL form of
LICENSE_KEY) and restart the server. - MongoDB (
MONGO_URImust not be disabled): Session events used for the replay are stored there. - For Sessions that include browser co-browsing, a separate Chromium container the server can reach over WebSocket, described below.
Sessions made only of screen sharing frames are rendered with ffmpeg directly and don't need the Chromium container (if you run the binaries instead of Docker, make sure ffmpeg is available on the PATH).
The Chromium Container
Browser co-browsing Sessions are replayed in a real browser. Use our upscope/chromium image:
docker run -d -e TOKEN=mytoken -p 3000:3000 upscope/chromium
Then point your Co-Browsing API instance at it with CHROMIUM_ENDPOINT=ws://yourdockerhost:3000?token=mytoken.
The container is configured through environment variables:
| Environment Variable | Description | Default |
|---|---|---|
TOKEN | The shared secret used to authenticate connections, passed in the endpoint's ?token= query. When unset, authentication is disabled entirely. | (nil) |
PORT | The port the container listens on. | 3000 |
POOL_MIN | The number of browsers kept warm and ready. | 1 |
POOL_MAX | The maximum number of concurrent browsers. Past this, requests queue. | 10 |
QUEUE_MAX_WAIT | How long a request waits for a free browser before failing, in milliseconds. | 8000 |
TIMEOUT | The maximum lifetime of a single browser session, in milliseconds. | 3600000 |
GOTO_TIMEOUT | The navigation timeout for the container's /screenshot and /pdf HTTP endpoints, in milliseconds. Not used for Session replays. | 10000 |
SHUTDOWN_GRACE | How long in-flight work gets to finish after SIGTERM before the process exits, in milliseconds. | 10000 |
LOG_CONNECTIONS | Log a line for each new connection from your Co-Browsing API instance. Set to false to disable. | true |
STATS_INTERVAL_MS | The interval of the periodic pool and load stats log line, in milliseconds. 0 disables it. | 60000 |
DEBUG | Debug log namespaces, e.g. upscope:*. | (nil) |
Fonts in Replays
/usr/share/fonts/custom and the container picks them up on start.Requesting a Recording
Nothing is rendered until you ask for it. Once a Session has ended, POST its session_id to {BASE_ENDPOINT}/api/recordings/{visitor_short_id}, authenticated with a short-lived HS256 token signed with your SECRET_KEY. The first call starts the render, later calls report progress, and the video URL comes back once it's ready. See Requesting a Session Recording for the full request and its responses.
A Session can't be rendered if no events were stored for it, if it needs a browser and CHROMIUM_ENDPOINT is unset, or if MongoDB is disabled.
You can skip recording an individual Session with the session_properties.record parameter on the watch link and viewer token endpoints.
Storing Recordings
Recordings can be stored on a local volume (the default), on Amazon S3, on Azure Blob Storage, or on Google Cloud Storage:
| Environment Variable | Description | Default |
|---|---|---|
RECORDINGS_STORAGE | volume stores recordings on disk under /recordings (mount a volume there to persist them) and serves them from {BASE_ENDPOINT}/recordings; s3, azure and gcs upload them to Amazon S3, Azure Blob Storage and Google Cloud Storage respectively. | volume |
RECORDINGS_S3_BUCKET | The S3 bucket recordings are uploaded to when using s3 storage. Falls back to S3_BUCKET. | (nil) |
ACCESS_KEY_ID, SECRET_ACCESS_KEY, AWS_REGION | The AWS credentials used for s3 storage. | (nil) |
RECORDINGS_AZURE_CONTAINER | The blob container recordings are uploaded to when using azure storage. Falls back to AZURE_CONTAINER. | (nil) |
AZURE_STORAGE_CONNECTION_STRING | The storage account connection string used for azure storage. | (nil) |
RECORDINGS_GCS_BUCKET | The Cloud Storage bucket recordings are uploaded to when using gcs storage. Falls back to GCS_BUCKET. | (nil) |
GCP_CREDENTIALS_JSON | The service account key JSON used for gcs storage. | (nil) |
RECORDINGS_BASE_URL | The public base URL recording links point to. Set it when using cloud storage (your bucket, container or CDN URL). | {BASE_ENDPOINT}/recordings |
CHROMIUM_ENDPOINT | WebSocket endpoint of the Chromium container used to replay browser Sessions. When unset, only screen sharing Sessions can be recorded. | (nil) |
RENDER_RECORD_ENDPOINT | The URL the Chromium container loads to render the replay. Override it when your BASE_ENDPOINT is not reachable from that container. | {BASE_ENDPOINT}/record |
Recording file URLs are not guessable (they contain a UUID), matching the access model of our cloud storage.