Using Relay
Relay lets you use your real Chrome browser as a session backend. The Browsr Chrome Extension bridges your authenticated tabs to the API via WebSocket -- automate pages you're already logged into without sharing credentials.
Setup
- Install the Browsr Chrome Extension from the Chrome Web Store
- Click the extension icon and sign in with your Browsr account
- Click "Start Relay" in the extension popup
- Your Chrome tab appears as a relay session in the API
Create a relay session
curl -X POST https://api.browsr.dev/relay/sessions \
-H "Authorization: Bearer $BROWSR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"tab_url": "https://example.com", "tab_title": "My Tab"}'
List relay sessions
curl https://api.browsr.dev/relay/sessions \
-H "Authorization: Bearer $BROWSR_API_KEY"
Send CDP commands to a relay session
Send Chrome DevTools Protocol commands directly to your relayed browser tab:
curl -X POST https://api.browsr.dev/relay/sessions/SESSION_ID/cdp \
-H "Authorization: Bearer $BROWSR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"method": "Page.navigate", "params": {"url": "https://example.com"}}'
Delete a relay session
curl -X DELETE https://api.browsr.dev/relay/sessions/SESSION_ID \
-H "Authorization: Bearer $BROWSR_API_KEY"