> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vsyble.com/llms.txt
> Use this file to discover all available pages before exploring further.

# JavaScript client

## Install

```bash theme={null}
npm install vsyble@4
```

Use Node.js 22.23.4+, 24.22.1+, or 26.12.1+ within those supported release lines. The client is for server-side or local code; keep API keys out of browser bundles.

## Search

```javascript theme={null}
import { VsybleApiClient, VsybleApiError, loadConfig } from "vsyble/client";

const client = new VsybleApiClient(loadConfig());

try {
  const searchResult = await client.search({
    query: "Heads of sales at US industrial manufacturers",
    target: "people",
    limit: 5,
    search_type: "auto",
    require_linkedin: true,
  });
  console.log(searchResult.request_id, searchResult.people);
} catch (error) {
  if (error instanceof VsybleApiError) {
    console.error(error.code, error.status, error.requestId);
  } else {
    throw error;
  }
}
```

Set `VSYBLE_API_KEY` in the environment or run `vsyble setup` to store the key locally. Client search fields use the same snake\_case naming as MCP; the client maps them to the REST body's `filters`.

## Enrich

Use the request ID from your search and positions actually returned in that result:

```javascript theme={null}
// Continue with the saved response from your search.
const result = await client.enrich({
  request_id: searchResult.request_id,
  result_numbers: [1, 3],
  field: "email",
});
```

Here `searchResult` is your saved search response. For companies, omit `field`. Preserve the exact reference and selection when continuing running work.

## Read campaigns

```javascript theme={null}
const workspace = await client.outreach("workspace", {});
const campaigns = await client.outreach("list_campaigns", {});
```

The client accepts the documented method name and maps it to its REST action. Inputs are validated against the method's contract before dispatch. API-key limitations still apply: inbox reply writes and scheduling require hosted OAuth.

## Cancellation and failures

Each operation accepts an optional second options argument with `signal` (the third argument for `outreach`):

```javascript theme={null}
const controller = new AbortController();
const result = await client.search(
  { query: "US sensor manufacturers", target: "companies", limit: 5, search_type: "auto" },
  { signal: controller.signal },
);
```

`VsybleApiError` exposes `code`, `status`, optional `requestId`, and `retryAfterSeconds`. Configuration errors are separate. The client does not turn an uncertain write into an automatic replay. Cancellation does not undo durable work already accepted.

## Configuration

| Variable | Purpose |
| - | - |
| `VSYBLE_API_KEY` | Credential; takes precedence over the saved key. |
| `VSYBLE_CONFIG_PATH` | Alternate saved-credential file. |
| `VSYBLE_API_BASE_URL` | API base URL; defaults to `https://api.vsyble.com`. |
| `VSYBLE_API_TIMEOUT_MS` | Integer from 5,000 to 180,000; default 70,000. |

Base URLs must use HTTPS, except localhost development. They cannot contain user credentials, query strings, or fragments. Do not redirect credentials to another host.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.