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

# Quickstart

From npm install to first reply in 5 lines of TypeScript.

# SDK quickstart

**Install**

```bash
    npm install @rogeriq/sdk
    ```
  **Initialize**

```ts
    import { RogerIQ } from "@rogeriq/sdk";

    const roger = new RogerIQ({
      apiKey: process.env.RIQ_API_KEY!,
      projectId: process.env.RIQ_PROJECT_ID!,
    });
    ```
  **Call the API**

```ts
    const open = await roger.conversations.list({ status: "open" });
    await roger.conversations.reply("con_xxx", "Thanks — looking into it.");
    await roger.agent.respond("con_xxx");
    ```

## Resource map

| `roger.…` | Methods |
|-----------|---------|
| `conversations` | `list`, `listAll`, `get`, `create`, `update`, `reply`, `resolve`, `snooze`, `assign` |
| `conversations.messages` | `list`, `send` |
| `contacts` | `list`, `listAll`, `get`, `upsert`, `update` |
| `kb` | `list`, `get`, `create`, `update`, `delete`, `publish`, `search` |
| `agent` | `status`, `getConfig`, `updateConfig`, `respond`, `classify`, `suggest` |
| `widget` | `getConfig`, `updateConfig` |
| `integrations` | `list`, `browseCatalog`, `getCatalogItem`, `getInstallUrl`, `updateLifecycle`, `disconnect` |
| `forms` | `list`, `get`, `create`, `update`, `archive`, `unarchive`, `submissions` |
| `beacons` | `list`, `get`, `create`, `update`, `archive`, `unarchive` |
| `webhooks` | `list`, `get`, `create`, `update`, `delete`, `test`, `deliveries`, `rotateSecret` |
| `projects` | `list`, `get`, `create`, `update`, `delete` |

## Multi-project

Don't pass `projectId` to the constructor — bind per-call:

```ts
const roger = new RogerIQ({ apiKey: process.env.RIQ_API_KEY! });

await roger.project("prj_a").conversations.list();
await roger.project("prj_b").kb.search("billing");
await roger.org("org_x").projects.list();
```

## Cloudflare Workers

```ts
import { RogerIQ } from "@rogeriq/sdk";

export default {
  async fetch(req, env) {
    const roger = new RogerIQ({
      apiKey: env.RIQ_API_KEY,
      projectId: env.RIQ_PROJECT_ID,
    });
    const conversations = await roger.conversations.list({ status: "open" });
    return Response.json(conversations);
  },
};
```

## Configuration

```ts
new RogerIQ({
  apiKey: "riq_xxx",
  projectId: "prj_xxx",       // optional default
  orgId: "org_xxx",           // optional default
  apiBase: "https://api.rogeriq.com",  // override for staging
  fetch: customFetch,         // override (testing)
  userAgent: "my-app/1.2",
  onResponse: (meta) => {
    if (meta.rateLimit && meta.rateLimit.remaining < 10) {
      console.warn("approaching rate limit", meta.rateLimit);
    }
  },
});
```

## What's next

**[Pagination](/sdk/pagination)**

`listAll()` async iterators that auto-walk cursor pages.
  **[Errors](/sdk/errors)**

`RogerIQError` with stable codes and request IDs.
  **[Webhooks](/sdk/webhooks)**

Verify incoming webhook signatures with Web Crypto.
  **[CLI](/cli/install)**

For shell + AI agent use.