khotan-data is shadcn × better-auth, but for data. Move data service-to-service, run ETL pipelines, or sync an external API into your Postgres — typed, debugged connections your coding agent defines and you own.
You need transactions from a bank's API flowing into your Postgres. Here is the work — with and without khotan.
npm i khotan-datanpx khotan add schemaTyped tables for plugs, flows, runs — migrated for you.
npx khotan add plug bankAn HTTP client scaffold with auth, retry, and pagination built in.
Your agent writes Zod-typed endpoints on the plug — the contract for the API.
npx khotan plug bank --compareFire the live API and diff the real response against your types until they line up.
npx khotan add inflowA scheduled, durable sync that loads straight into your Postgres.
Every connection is the same shape: a typed plug talks to the API, a flow moves the data on Vercel Workflow, and it lands in your own Drizzle tables.
Just like better-auth, khotan installs a single catch-all route in your app. Your client calls it over HTTP. Your server code skips the HTTP entirely. Both end up in the same typed handler — which talks to your Drizzle schema and external APIs for you. Extremely narrow, fully extensible.
app/api/khotan/[...all]/route.ts// One catch-all route. All components route through here.import { khotanData } from '@/lib/khotan'import { toNextJsHandler } from 'khotan-data/next-js' export const { GET, POST } = toNextJsHandler(khotanData.handler)any client, server, or route file// From the frontend → goes over HTTP'use client'await khotanClient .plug.create({ provider: 'stripe' }) // From the server → skips HTTP, direct callawait khotanData.api .plug.create({ provider: 'stripe' }) // From another handler → same direct callawait khotanData.api .inflow.run({ source: 'stripe' })List the components you want in khotan.config.ts. The package wires up the handler.
The CLI drops a single catch-all route. You never edit it.
Typed API surface, same on client and server. Handler hits Drizzle and external APIs for you.
khotan-data ships built-in agent skills — focused SKILL.md guides that teach your coding agent how to do one integration job well. On khotan init, they install straight into Cursor, Claude Code, Codex, Copilot, Kiro, and Roo. Purpose-built for integration and syncing.
khotan-buildThe orchestrator. Run the end-to-end integration workflow — docs to working sync — with the consent gates that keep an agent safe. Start here.
$ npx khotan add skill-buildkhotan-setupStand up khotan in a Next.js + Drizzle + Postgres project — factory config, schema, migrations, env vars, and recovery when setup is incomplete.
$ npx khotan add skill-setupkhotan-plugAuthor plugs — HTTP clients with auth strategies, runtime vars, hooks, and Zod-typed endpoints. The contract for any external API.
$ npx khotan add skill-plugkhotan-probeDebug plugs from the CLI. Fire live requests and diff the real payload against your typed endpoints until the schema matches reality.
$ npx khotan add agent-skillkhotan-flowBuild and run inflows, outflows, and relays on Vercel Workflow — pull data in, push it out, or move it plug-to-plug, then trigger and schedule.
$ npx khotan add skill-flowkhotan-webhookReceive and process webhooks with Wires, Catch, and Pass — subscriptions, signature verification, durable processing, and forwarding.
$ npx khotan add skill-webhookkhotan-cacheAdd durable, named caches to flows and webhooks for upstream snapshots, run checkpoints, and dedupe markers with optional TTL.
$ npx khotan add skill-cachekhotan-mappingsDefine resources and match records across services with a canonical connect key plus per-plug refs, keeping upserts idempotent.
$ npx khotan add skill-mappingskhotan-frontendSuggest the right drop-in components and page blocks — Hub, debugger, logs, mappings — and never inject UI or add routes unprompted.
$ npx khotan add skill-frontendAgent routerInstalls every skill into Cursor, Claude Code, Codex, Copilot, Kiro, and Roo, and drops an AGENTS.md router at your project root.
$ npx khotan init --yesSame retry contract. Same idempotency story. Same observability surface. Stack them like LEGO.
Wire your app to an external API — encrypted creds, typed client, optional connect-account UI. The foundation every other component sits on.
One-way HTTP client to an external API — auth strategies, retry with backoff, pagination, and optional typed endpoints with Zod.
Catch a webhook and write it to your Postgres. Signed verification, idempotent, raw body capture. Writes to your Drizzle tables.
Catch a webhook and pass it through to another service. Signed in, signed out, retried delivery. No staging in your DB.
External service → your Postgres. Pull from a SaaS API, transform, load into your Drizzle tables.
Your Postgres → external service. Push audiences, scores, enrichments to Salesforce, HubSpot, Intercom.
External → external. Transit data between two SaaS systems without staging in your DB.
Config card listing every Flow with toggles and a manual Run-now button. Backed by the standard khotan_flows table.
Drop-in shadcn data table of every flow run — status, stats, full step-by-step trace per row. Reads from the standard khotan_runs table.
We are intentionally narrow. Drizzle ORM is the only adapter today — because that constraint lets us guarantee every schema patch is correct. App Router native. Vercel Workflow for durability. Zod for validation. Every generated file looks like code your team would have written, because it is.