You write a function, call it from a screen and run one command. Everything between those three steps is ArkAPI's job. These pages open it up: what happens, why it was built that way, and where to find it. Paths point into the arkapi repository unless they say host.
Diagram
your project on the phone
──────────── ────────────
notes.api.ts ── generate ──► notes.api.ets ─► built into the app
│ (typed client) │
│ deploy │
▼ │
┌─ ArkAPI host ────────────────────┐ │
│ your backend, bundled │◄── calls ──────┤
│ own process · own user │ │
│ SQLite · files · jobs │── live data ──►┘
└──────────────────────────────────┘ & events
The tricks#
| Page | The "wait, how?" moment |
|---|---|
| From signature to client | One import line means two different files, and your TypeScript types reach ArkTS without a schema file. |
| Live data without wiring | A screen subscribes to a query without naming it, and updates without you saying what changed. |
| Teaching DevEco about Bun | bun:sqlite autocompletes inside a HarmonyOS IDE that has never heard of Bun. |
| Deploys that keep the line open | A deploy swaps the server under a live chat and nobody's screen notices. |
| Made for coding agents | The same docs URL answers a browser with HTML and an agent with Markdown. |
The rules behind every trick#
- One source of truth. The function signature is the contract. Nothing is written twice, so nothing drifts.
- Fail on the laptop, not on the phone. A wrong type stops
generate; a renamed field stops the ArkTS build. - Boring parts, clever seams. SQLite, WebSockets, systemd and the TypeScript compiler do the heavy lifting. ArkAPI is mostly the glue between them.