Connect a worker

Connect a coding agent on your machine, such as Claude Code, as a worker that takes a project's runs and answers them. It asks Veryfront for work, so it needs no public address.

Before you start

You need a project with an agent. See Create an agent.

Connect a worker

  1. Install the SDK:
    Shell
    npm install veryfront
  2. Save the worker. It registers itself with your API key, then sends a heartbeat so it stays online:
    worker.mjs
    import { createExternalAgentWorkerClient } from "veryfront/agent"; const client = createExternalAgentWorkerClient({  apiUrl: process.env.VERYFRONT_API_URL ?? "https://api.veryfront.com",  authToken: process.env.VERYFRONT_API_KEY,});const worker = await client.registerWorker({  projectReference: process.env.PROJECT,  implementationKind: "claude-code",  implementationDisplayName: "Claude Code",  workerKey: "laptop",  displayName: "Laptop",});const beat = await client.heartbeatWorker(worker.id);console.log(`${beat.display_name}: ${beat.status}`);
  3. Set PROJECT to your project's ID (Find your IDs): export PROJECT=<id>.
  4. Run it. You should now see Laptop: active, and Laptop Online under Agents > Connected in Studio:
    Shell
    node worker.mjs

Try it in a sandbox

  1. Install the SDK

  2. Save the worker

  3. Set PROJECT

  4. Run it

  5. Check it

Try it out

Next steps