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

# Node.js SDK

> Build a production-ready Node.js API client wrapper with retries, typed responses, and safe error handling.

# Use a maintained internal client wrapper today.

Until an official package is published, implement a shared internal client module and version it in your platform repo.

## Recommended wrapper capabilities

* Base URL and auth header injection.
* Structured error parsing (`error_code`, `request_id`).
* Retry policy for transient failures.
* Request timeout and telemetry hooks.

<CodeGroup>
  ```javascript Node.js theme={null}
  export async function callaro(path, init = {}) {
    const response = await fetch(`https://api.callaro.ai${path}`, {
      ...init,
      headers: {
        'X-Api-Key': process.env.CALLARO_API_KEY,
        'Content-Type': 'application/json',
        ...(init.headers ?? {})
      }
    });
    const payload = await response.json();
    if (!response.ok) throw new Error(`${payload.error_code}: ${payload.error}`);
    return payload;
  }
  ```
</CodeGroup>

## Usage pattern

1. Keep one client instance per service.
2. Wrap endpoint calls in feature-specific modules (`campaigns.ts`, `contacts.ts`).
3. Log `request_id` for failed calls.
4. Add contract tests for critical workflows.

## Maintained downloads guidance

* Keep starter wrapper and examples in your internal template repo.
* Pin required Node runtime in project tooling.
* Update wrapper alongside API contract changes from changelog.

## What to do next

* Start with [`../getting-started/quickstart`](../getting-started/quickstart) for a first working workflow.
* Use [`../api-reference/overview`](../api-reference/overview) as the base contract reference.
* Import the maintained [`./postman`](./postman) collection for request discovery and smoke tests.
