Skip to main content

Session Replay with BQL

The Session Replay feature in BrowserQL allows you to record browser sessions and later replay them for debugging and analysis. When using BQL, session recording is controlled through connection parameters and provides seamless integration with GraphQL mutations.

This feature is particularly useful for:

  • Debugging complex BQL automation workflows
  • Creating visual documentation of GraphQL-based browser automation
  • Troubleshooting BQL mutations with recorded evidence

Session Replay Demo

Prerequisites

Before using Session Replay with BQL, make sure you have:

  1. A Browserless account with Session Replay access
  2. A browserless API key
  3. Access to the BQL endpoint
  4. Understanding of GraphQL mutation syntax

Recording a Session with BQL

Connection String Configuration

To enable session recording with BQL, add the replay=true parameter to your connection string:

wss://production-sfo.browserless.io?token=YOUR_API_TOKEN_HERE&replay=true

Basic Recording Example

curl --request POST \
--url 'https://production-sfo.browserless.io/chrome/bql?token=YOUR_API_TOKEN_HERE&replay=true' \
--header 'Content-Type: application/json' \
--data '{"query":"mutation replay {\n goto(url: \"https://www.browserless.io\") {\n \ttime\n }\n click(selector:\"a\"){\n time\n }\n waitForTimeout(time:2000){\n time\n }\n}","variables":{},"operationName":"replay"}'