---
title: Introduction
description: khotan-data adds production-grade data flow, ETL, webhook, dashboard, and agent-skill components to your Next.js + Drizzle + Postgres app.
section: Get Started
url: /docs
---

# Introduction

khotan-data is an opinionated toolkit for building data movement, webhook, and operational tooling inside a Next.js app. It is designed for TypeScript, Drizzle, and Postgres, and it scaffolds code into your repo instead of hiding the runtime behind a hosted service.

Think "shadcn for data plumbing". You install the package, run `khotan` commands, and get generated files for plugs, flows, wires, webhook handlers, dashboard components, and ready-made route blocks. The package also ships built-in **agent skills** so coding agents can understand how to work with khotan in a real app.

## What you get

- **Plug** for HTTP clients with auth, retry, pagination, vars, hooks, and typed endpoints.
- **Wire**, **Catch**, and **Pass** for webhook registration, verification, durable processing, and forwarding.
- **Inflow**, **Outflow**, and **Relay** for scheduled or manual data movement.
- **Hub**, **Runs**, **Logs**, and **Plug Debugger** for operational UI and debugging.
- **Blocks** like `config-page-1`, `graph`, `logs-page-1`, and `debug-page-1` so you can install a whole page, not just a primitive.
- **Agent skills** installed into detected agent directories so Cursor, Claude Code, Codex, Copilot, Kiro, and Roo can use khotan more effectively.

## The model

There is one central runtime:

- a factory config at `src/khotan/khotan.ts` or `khotan/khotan.ts`
- a catch-all route at `app/api/khotan/[...all]/route.ts` or `src/app/api/khotan/[...all]/route.ts`
- standard Drizzle tables for plugs, resources, flows, wires, webhook handlers, webhook events, runs, and mappings

Everything else plugs into that surface.

## Fast start

For most projects, this is the shortest path:

```terminal
$ npm install khotan-data
$ npx khotan init --yes
$ npx khotan add schema --yes
$ npx khotan migrate
$ npx khotan add plug --yes
$ npx khotan add inflow --yes
$ npx khotan add hub --yes
```

Then:

- register your plug, flows, wires, and webhook handlers in `khotan.ts`
- run your app
- use the CLI and the dashboard against `/api/khotan/*`

## Built for humans and agents

The docs site is intentionally dual-format:

- every major doc page has a rendered page under `/docs/...`
- the same content is also available as raw markdown under `/docs/... .md`

That makes it easy for humans to browse and easy for agents, scripts, and LLM tooling to crawl and ingest the exact documentation source.

If you are an agent, start here:

- read `/docs/agents`
- read the project-root `AGENTS.md` after `khotan init --yes` or after skills are installed
- prefer the `.md` routes when you want raw content with less visual noise

## Stack

This is the supported target stack today:

- Next.js App Router
- TypeScript
- Drizzle ORM
- Postgres
- Vercel Workflow for durable flow and webhook execution

## Skills are included

khotan ships skill templates and an `AGENTS.md` router. During `npx khotan init`, the CLI can install all built-in skills automatically. You can also install them one by one:

```terminal
$ npx khotan add skill-build
$ npx khotan add skill-setup
$ npx khotan add skill-plug
$ npx khotan add agent-skill
$ npx khotan add skill-flow
$ npx khotan add skill-webhook
$ npx khotan add skill-cache
$ npx khotan add skill-mappings
$ npx khotan add skill-frontend
```

These teach agents how to:

- run the end-to-end integration workflow (the `khotan-build` orchestrator)
- set up khotan in a new project
- build and debug plugs
- build flows (inflow, outflow, relay)
- connect wires and implement webhook flows
- add caching and cross-service mappings
- suggest frontend components and blocks
- use the `khotan plug` CLI effectively

## Next steps

- [Installation](/docs/installation) for the end-to-end setup order.
- [Basic Usage](/docs/basic-usage) for a realistic plug + flow + webhook example.
- [Components](/docs/components) for every installable component and its command.
- [Blocks](/docs/blocks) for ready-made routes.
- [Agent Guide](/docs/agents) for the built-in skills and the most crawlable paths.
