This guide will walk you through the essential steps to get started with Vern.

1. Create a Task in the UI

Tasks define the specific actions Vern can perform within a browser.

  1. Navigate to the Tasks page in the Vern dashboard.
  2. Click “New Task” and define the browser actions you want to automate.
  3. Configure the necessary inputs (e.g., search terms, form fields) and how Vern should interact with websites to complete the task.
  4. Once created, note down the Task ID displayed for your new task.

2. Install the SDK

npm install vern

3. Initialize the SDK

Import and initialize the Vern SDK with your API key:

import Vern from "vern";

const vern = Vern({ apiKey: "YOUR_API_KEY" });

4. Run a Task

You can run a task using the explicit runs.create method:

const run = await vern.runs.create({
  taskId: "getCarDetails",
  inputs: { registration: "YLG19A" },
});

5. Poll for Run Completion

You can poll for the run to complete using a helper function:

async function pollRunUntilComplete(runId, interval = 10000) {
  while (true) {
    const runDetails = await vern.runs.retrieve(runId);
    if (runDetails.status === "completed") {
      return runDetails;
    }
    await new Promise((resolve) => setTimeout(resolve, interval));
  }
}

const completedRun = await pollRunUntilComplete(run.id);
// completedRun.result will have the extracted response data when done (if specified)

Example of a completed run response:

{
  "id": "1acsd6-03b4-4402-84c8-4d2a555b1a4a",
  "task": "Get car details",
  "status": "completed",
  "created_at": "2025-05-05T02:07:58.444979Z",
  "started_at": "2025-05-05T02:09:23.379952Z",
  "completed_at": "2025-05-05T02:09:23.379952Z",
  "inputs": {
    "registration": "YLG19A"
  }
  "response": {
    "carDetails": {
      "make": "Hyundai",
      "model": "i30",
      "year": "2017"
    }
  }
}

Next Steps

You’ve successfully defined a task and executed a run!

Explore the documentation further to learn about:

  • Creating more complex browser automation tasks
  • Setting up advanced configurations
  • Error handling and debugging
  • Integrating Vern with your application workflow
curl -X POST https://vern.so/api/v1/runs \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "taskId": "getCarDetails",
    "inputs": {
      "registration": "YLG19A"
    }
  }'