Documentation

Quickstart

In the next four steps you will install the SDK, grab an API key, rent your first browser, drive it through one navigation and one JavaScript evaluation, then release the session. Start to finish in under a minute.

TL;DR
  • Install the SDK in your language of choice.
  • Grab an API key from your dashboard.
  • Copy the example below and replace YOUR_API_KEY.
  • Run it; you should see Example Domain printed.

1. Install

go get wrc-beta.xyz/wrc_go

Go users need Go 1.21+; Node users need Node 18+. The Go module ships the gRPC stubs precompiled, the npm package ships an ES-module build with bundled types.

2. Get an API key

WRC charges credits per minute, rounded up — and the full reserved window is deducted upfront when you call RentBrowser, refunded automatically if the rent itself fails. Top up a few credits before you start.

  1. Sign up at wrc-beta.xyz/register.
  2. Open the API key page.
  3. Copy the sk_… value into the snippet below.

For development a plain .env file is fine; the SDK never reads env vars on its own, you always pass the key explicitly.

3. Your first script

The script below is the smallest end-to-end WRC program. It rents a session, navigates to example.com, evaluates one line of JavaScript on the page, and stops cleanly. Every later example in these docs is just a variation on this skeleton — so it is worth reading the comments rather than just copy-pasting.

package main

import (
  "context"
  "fmt"
  "log"

  wrc "wrc-beta.xyz/wrc_go"
)

func main() {
  ctx := context.Background()

  // 1. Configure the rental. Empty proxy fields tell WRC to allocate
  //    a managed proxy server-side; pass your own host/port/creds to
  //    bring your own.
  cfg := wrc.NewBrowserConfig(
      "YOUR_API_KEY", // sk_…
      300,            // rentDuration in seconds (5 minutes)
      "", 0, "", "",  // proxy host / port / user / pass
  )

  // 2. Rent a fresh browser session.
  browser, err := wrc.RentBrowser(ctx, cfg)
  if err != nil {
      log.Fatal(err)
  }
  defer browser.Close() // always release the session

  // 3. Drive it.
  if _, err := browser.Navigate(ctx, "https://example.com", 0); err != nil {
      log.Fatal(err)
  }

  res, err := browser.Evaluate(ctx, "document.title")
  if err != nil {
      log.Fatal(err)
  }
  fmt.Println("title:", res.Value)
}

4. Run it

go run main.go
# title: Example Domain

If you see title: Example Domain, congratulations — the script just rented a real Chromium session somewhere on our infrastructure, drove it through a navigation and a JS call, and released it. From here, every other method in the SDK is incremental.

What can go wrong

The three errors people hit on their first script (the SDK forwards the server's machine-readable code verbatim):

  • rent failed: INVALID_API_KEY — the key was copied with a leading or trailing space, or it belongs to a different account than the endpoint you are hitting. Re-copy from the dashboard.
  • rent failed: INSUFFICIENT_CREDITS — your balance is below the cost of rentDuration / 60 minutes (rounded up). Top up under Billing.
  • Hangs for ~30 seconds, then context deadline exceeded — your network is blocking outbound gRPC. Try a different network; corporate proxies usually need to whitelist *.wrc-beta.xyz.

If you bring your own proxy, also watch out for PROXY_CONNECTION_FAILED (WRC reachability-checks every proxy you submit before renting) and INSUFFICIENT_PROXY_QUOTA when the managed proxy pool is dry for your plan.

See also
  • The Go SDK reference lists every method, signature, and option.
  • navigate returns when the page commits, not when it finishes loading — that distinction is covered in Core concepts.
  • evaluate is the escape hatch when no built-in method does what you need.