# @onereach/types-hitl-api

> Backend API for Human in the Loop. This service handles session, agent, migration, task, and browser-facing API behavior used by the `hitl` frontend and related platform integrations.

Latest version **1.0.11-rc.10** (published 2026-09-22) · 0 weekly downloads

## Install

```sh
npm install @onereach/types-hitl-api
pnpm add @onereach/types-hitl-api
yarn add @onereach/types-hitl-api
bun add @onereach/types-hitl-api
```

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.0.11-rc.10 |
| Published | 2026-09-22 |
| First published | 2022-01-21 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 59.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | OneReach.ai |
| Maintainers | onereach.admin, user.npm |

## Links

- npm: https://www.npmjs.com/package/@onereach/types-hitl-api
- npm.io page: https://npm.io/package/@onereach/types-hitl-api

## Recent versions

- 1.0.11-rc.10 (latest) — 2026-09-22
- 1.0.11-rc.8 — 2026-09-17
- 1.0.11-rc.5 — 2026-09-10
- 1.0.11-rc.4 — 2026-09-09
- 1.0.11-rc.0 — 2026-09-02
- 1.0.10 — 2026-09-02
- 1.0.10-rc.1 — 2026-09-02
- 1.0.10-rc.0 — 2026-09-02
- 1.0.9 — 2026-09-02
- 1.0.9-rc.6 — 2026-08-28
- 1.0.9-rc.5 — 2026-08-25
- 1.0.9-rc.2 — 2026-08-18
- 1.0.9-rc.1 — 2026-08-13
- 1.0.9-rc.0 — 2026-08-05
- 1.0.8 — 2026-08-05
- … 332 more at https://npm.io/package/@onereach/types-hitl-api/versions

## README

# HitL API

Backend API for Human in the Loop. This service handles session, agent, migration, task, and browser-facing API behavior used by the `hitl` frontend and related platform integrations.

## Local Development

Requirements:

- Node.js 20+
- npm 10+
- Docker Desktop or another local PostgreSQL setup
- `OR_NPM_TOKEN` for private dependencies
- deploy-platform installed locally so config can be generated

### 1. Install dependencies

```bash
npm install
```

### 2. Start PostgreSQL

Example with Docker:

```bash
docker pull postgres
docker run --name postgresql-local -e POSTGRES_USER=hitl-app -e POSTGRES_PASSWORD=mysecretpassword -e POSTGRES_DB=hitl-app-db -p 5432:5432 -d postgres
```

### 3. Create `.env`

```conf
APP_DEV_PORT=8080
DB_USER=hitl-app
DB_PASSWORD=mysecretpassword
DB_HOST=localhost
DB_PORT=5432
DB_NAME=hitl-app-db
SCHEDULED_TASKS_SWITCH='{"ARCHIVE_SESSION_EVENTS":true,"CLEAN_UP_LISTENERS":true,"CLEAN_UP_SESSIONS":true,"ADD_EVENTS_TO_ARCHIVE":true,"ADD_MEMBERS_TO_ARCHIVE":true,"CLEAN_UP_CONTACTLESS_SESSIONS":true,"CLEAN_UP_SCHEDULED_MESSAGES":true,"FIX_EXPIRED_AGENT_STATUSES":true,"SEND_SCHEDULED_MESSAGES":true,"DELETE_EXPIRED_SESSIONS":true,"LONG_EXPIRE_DAYS":7,"SHORT_EXPIRE_DAYS":1}'
```

### 4. Generate deploy config

```bash
or get-config --branch local --client development --env qa --feature master --project hitl-api --service hitl_api.config --service-or-eval service > config.json
```

### 5. Start the server

```bash
npm start
```

### 6. Run migrations

```bash
curl --location --request POST 'http://localhost:8080/api/v1/migrations' --header 'Authorization: user'
```

### 7. Run tests

```bash
npm test
```

## Main Areas

- `src/api/` and `src/api-express/`: serverless and express entrypoints
- `src/api-common/`: shared middleware, auth, logging, validation, and versions endpoints
- `src/api-express/migrations/`: SQL and migration management
- `tests/`: Jest-based backend coverage

## Shared Parent Domain Aliases

`hitl-api` participates in the shared-parent-domain alias flow as a supporting API for branded `hitl` deployments.

That means:

- browser-facing host trust should be explicit
- CORS behavior should be driven by configured trusted hosts
- deploy-platform config must stay aligned with the UI aliases and allowed hosts used by the frontend

Read the full platform behavior here:
[deploy-platform shared-parent-domain alias documentation](https://gitlab.internal.onereach.io/onereach/platform/deploy-platform/docs/shared-parent-domain-aliases.md)

---
_Source: https://npm.io/package/@onereach/types-hitl-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
