Skip to content

Private previewMost of the architecture is written. First public release in 2027.

API reference

Every public export of Hamur has a section in this reference, with its signature and a short example. The examples are real files in landing/samples/api/ that the repository's check compiles, so they match the code.

PageImport fromWhat it holds
hamurhamurdefineConfig and the config types
hamur/apphamur/appcode that runs in pages: loaders, middleware, errors, state, head, $fetch, app plugins
hamur/serverhamur/servercode that runs on the server: handlers, request and response utilities, sessions, storage, cache, WebSockets
hamur/kithamur/kitthe module author's tools
hamur/adapterhamur/adapter, hamur/adapter/devwhat an adapter implements, and its dev-only helpers
@hamur/adapter-<library>@hamur/adapter-react, @hamur/adapter-vue, @hamur/adapter-preact, @hamur/adapter-solid, @hamur/adapter-svelte, @hamur/adapter-htmlthe hooks and components of each adapter, one section per name
@hamur/i18n@hamur/i18nthe i18n module, its options and useApp().i18n
@hamur/db@hamur/db, @hamur/db/server, @hamur/db/clithe db module, its connections, migrations, useDatabase and runDbCommand

A name that two entry points export, such as $fetch and createError, is documented on both pages and is the same function.

How the pages are written

  • A function has one section with its signature and an example.
  • Types that belong to a function are grouped in one section after it, with a table of their fields.
  • src/ directories and internal modules, such as the files in hamur's src/runtime/, are not public and are not listed.

The script scripts/check-api-docs.ts runs in bun run check as check:api-docs. It reads the export statements of each entry point's index file and fails, naming the export, when a page has no heading that contains that name in backticks. It also reads the exports of every package and fails when an entry such as hamur/kit has no heading naming it.