# CareWay Node.js SDK

Requires Node.js 18+ and has no runtime dependencies. TypeScript declarations are included.

Install the package directly from CareWay:

```bash
npm install https://carewayrussia.ru/assets/sdk/careway-node-v1.tgz
```

Then import it from server-side Node.js:

```js
import { CareWay } from "@careway/api";

const client = new CareWay({ apiKey: process.env.CAREWAY_API_KEY });
const chat = await client.createChat({ title: "Диагностика" });
const answer = await client.sendMessage(chat.id, { text: "Ошибка P0087" });
console.log(answer.assistantMessage.content);
```

The API key is a server secret. Do not embed it into browser or mobile code.
