Skip to content

Test

Status: NEEDS-ACCOUNT (paid)

Classification: NEEDS-ACCOUNT (paid cloud service) Install method: No SDK. Use Playwright as the client library (npm install playwright). Connect via Surfsky WebSocket URL. Cost tier: Paid only. No free tier. Requires a paid subscription at surfsky.io. What is required: A paid Surfsky account at surfsky.io and a valid API key (SURFSKY_API_KEY). No self-hosted option.


Smoke Test: CDP Connection + Page Title

Save the following as smoke.mjs and run it with a valid API key. It connects to a Surfsky cloud browser, navigates to https://example.com, prints the page title, and exits cleanly.

javascript
// smoke.mjs
import { chromium } from 'playwright';

const key = process.env.SURFSKY_API_KEY;
if (!key) {
  console.error('Set SURFSKY_API_KEY before running');
  process.exit(1);
}

const browser = await chromium.connectOverCDP(
  `wss://surfsky.io/?key=${key}&profile=smoke_test`
);

const page = await browser.newPage();
await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });
const title = await page.title();
console.log('Title:', title);

await browser.close();
console.log('PASS');

Run it:

bash
SURFSKY_API_KEY=your_key_here node smoke.mjs

Expected Success Output

Title: Example Domain
PASS

If the connection fails (wrong key, plan limit exceeded, or network error) Playwright throws a WebSocket connection error before the page navigation. Common failure messages:

  • WebSocket connection failed -- check the API key and your account status at the Surfsky dashboard
  • Target closed -- the session was closed server-side; retry or check your concurrency quota
  • No output / timeout -- verify your plan allows at least 1 concurrent browser

Checking Account Status

Log in at https://surfsky.io/ and check the dashboard for remaining browser-hours, session counts, and current concurrency usage before running high-volume tests.