JavaScript SDK

The @quin/camoufox-local TypeScript SDK for Node.js — connect to the Quin Local API, drive browsers, run RPA tasks and stream events.

SDKs and toolsApplies to Quin Camoufox 0.7Updated 2 November 2026

@quin/camoufox-local is the TypeScript/JavaScript client of the Local API for Node.js 18 or newer. It has no runtime dependencies (it uses Node's built-in fetch) and ships its own type definitions.

Install

The SDK is distributed as source with Quin Camoufox's developer materials (version 0.7.0). Build it once, then import it from its dist folder or pack it into your project:

Download the TypeScript/JavaScript SDK package from Developer downloads on the download page, check its SHA-256, then add it to your project:

PowerShell
npm install .\{{quin.js_sdk}}

The package is an ES module (import). From CommonJS, require() works on Node 22.12 and newer; on older Node use await import("@quin/camoufox-local").

Connect

TypeScript
import { QuinClient } from "@quin/camoufox-local";

const client = new QuinClient({ baseUrl: "http://127.0.0.1:50380" }); // token from QUIN_API_TOKEN
const status = await client.status();
console.log(status.quin_version, status.account.email);

new QuinClient(options):

OptionDefaultNotes
baseUrlrequiredWith or without /api/v1; a non-loopback host is refused unless allowNonLoopback: true
tokenprocess.env.QUIN_API_TOKENThe JS SDK does not read the file stored by quin auth set-token
timeoutMs30000HTTP timeout
actionTimeoutMs120000For actions without timeoutMs
maxRetries3
backoffMs500Exponential backoff base
maxRetryAfterMs30000Longest Retry-After honoured
signal–An AbortSignal that cancels every request of this client

QuinClient.fromLocalConfig({ configPath?, ...options }) uses QUIN_API_URL if set, otherwise the discovery file; a missing file throws ApiUnavailable.

Open a browser and act

TypeScript
import { QuinClient, Locator, ActionError } from "@quin/camoufox-local";

const client = QuinClient.fromLocalConfig();
const browser = await client.browsers.open({ profileId: "AbCd1234", timeoutS: 300 });
try {
  const nav = await browser.navigate("https://example.com", { waitUntil: "load" });
  console.log(nav.status, await browser.title(), await browser.text("h1"));
  await browser.click(Locator.role("link", "More information"));
  const shot = await browser.screenshot({ fullPage: true, name: "example.png" });
  console.log(shot.file, shot.bytes);
} catch (err) {
  if (err instanceof ActionError) console.error(err.action, err.code, err.message);
  else throw err;
} finally {
  await browser.close({ sync: true }); // resolves at SYNCED for a Quin Cloud profile
}

browsers.open({ profileId, startUrl?, window?, wait?, timeoutS?, idempotencyKey? }) returns a BrowserSession; timeoutS defaults to 300. With wait: false call await session.waitReady() before acting. browsers.withSession(options, fn) opens, runs fn and always closes with sync. browsers.session(id) makes a handle for a known session id without a request.

BrowserSession

Getters id, profileId, state, kind, plus data and jobId. Methods refresh(), waitReady({ timeoutS?, pollIntervalMs? }), takeover(), close({ sync?, wait?, timeoutS? }).

Generic call: action(name, { locator?, params?, tab?, timeoutMs? }) with snake_case params, as on the wire. Helpers take an options object last ({ tab?, timeoutMs? } plus their own options):

GroupMethods
Navigationnavigate(url, { waitUntil }), reload(), back(), forward(), url(), title()
Elementsclick(loc, { position, modifiers }), dblclick(loc), rightClick(loc), hover(loc), focus(loc), fill(loc, value), type(loc, text, { delayMs }), clear(loc), press(key, { locator }), select(loc, { values } | { labels }), check(loc), uncheck(loc), scrollIntoView(loc), scrollBy(x, y), dragTo(loc, target), upload(loc, files), highlight(loc)
WaitingwaitFor(loc, { state }), waitForUrl(pattern), waitForLoad(state), waitForText(text), waitForResponse(urlPattern, { status })
Readingtext(loc), innerHtml(loc), attribute(loc, name), value(loc), selectedValues(loc), count(loc), isVisible(loc), isEnabled(loc), isChecked(loc), extract({ fields, item?, limit?, locator? }), table(loc = "table"), links({ locator?, limit? })
Filesscreenshot({ fullPage?, name?, locator? }), saveContent(name), expectDownload(trigger, { saveAs })
Tabstabs(), newTab(url?), switchTab(tab), closeTab(tab?), waitForPopup(trigger), setViewport(width, height), dialogPolicy(accept, promptText?)

Locators

A string is a CSS selector. Builders: Locator.css(), Locator.text(text, exact?), Locator.role(role, name?, exact?), Locator.label(), Locator.placeholder(), Locator.testId(), Locator.xpath(), then .nth(i), .exact(), .hasText(text), .inFrame(selector). Plain objects such as { role: "button", name: "Save" } work too.

Resources

PropertyMethods
client.profileslist({ q, groupId, tag, kind, runtimeId, status, page, pageSize }), iterAll(filters) (async generator), get(id), create(body, { idempotencyKey }), update(id, fields), bulk(ids, set), cloneConfig(id, { name, idempotencyKey }), trash(id), restore(id), revisions(id), syncStatus(id), sync(id), runtime(id)
client.groupslist(), create(body), update(id, fields)
client.proxieslist(), create(body), update(id, fields), delete(id), assign(id, profileIds), check(id)
client.runtimeslist()
client.configurationslist({ q, os, page, pageSize })
client.browsersopen(o), withSession(o, fn), list(), get(id), session(id), close(id, opts), closeAll({ includeUser }), tabs(id)
client.workflowslist(), get(id), create(workflow, { idempotencyKey }), update(id, workflow), delete(id), publish(id, note?), importJson(data, { mode, preview }), export(id)
client.tasksrun({ workflowId, profileIds, groupId, filter, version, inputs, dataset, concurrency, timeoutS, retries, errorPolicy, closePolicy, idempotencyKey }) → Task, get(id), list(), cancel(id)
client.runsget(id)
client.scheduleslist(), create(body), update(id, fields), delete(id)
client.jobsget(id) → Job, list(), cancel(id), wait(id, { timeoutMs, pollIntervalMs, raiseOnError })

Request bodies of create/update use the API's snake_case field names (group_id, proxy_id). profiles.create() takes the profile's platform (os is accepted as an alias since 0.7.0-rc.4).

Run a workflow

TypeScript
const task = await client.tasks.run({
  workflowId: "wf_123", profileIds: ["AbCd1234"], inputs: { query: "x" },
  idempotencyKey: `nightly-${Date.now()}`,
});
await task.wait({ timeoutMs: 3_600_000, pollIntervalMs: 2000 });
console.log(task.state, task.runs.map((r) => r.state));

Task and Job expose id, state, data, done, refresh(), wait({ timeoutMs?, pollIntervalMs?, raiseOnError? }) and cancel(); Task adds jobId and runs, Job adds result.

Events

TypeScript
const ac = new AbortController();
for await (const ev of client.events({ kinds: ["browser.closed", "job.updated"], signal: ac.signal })) {
  console.log(ev.id, ev.kind, ev.data);
}

events({ kinds?, lastEventId?, reconnect?, readTimeoutMs?, maxReconnectDelayMs?, maxReconnects?, signal? }) reconnects with Last-Event-ID; abort the signal to stop.

Errors, cancellation and retries

Errors are QuinError subclasses — AuthError, PermissionDenied, NotFound, Conflict, SessionBusy, InvalidRequest, RateLimited (retryAfter), ServerError, ActionError (action, actionId, durationMs), QuinTimeout, ApiUnavailable — with code, message, status, details. See Errors.

An aborted signal rejects with code cancelled and is never retried. Cancelling the HTTP call does not stop work Quin already accepted: use jobs.cancel() or tasks.cancel(). Requests without an idempotency key are retried only after a 429; GET is also retried on network errors and 502/503/504.

The example node_basic.mjs (list, open, navigate, title, screenshot, close) ships with the SDK examples.