Documentation
Guides and reference for developers building on Basehim: themes, apps, the REST API and AI agents. The examples on these pages were run against Basehim 1.2.53 before they were published.
New to Basehim? Read Getting started, then follow Build your first app or Build a theme from scratch.
Basics
- Getting started with Basehim development: themes, apps and the API, how a request flows, and a local setup in five minutes.
- Installation: requirements, shared hosting, subfolders, nginx, cron and troubleshooting.
- Configuration and the .env file: every setting Basehim reads from
.env. - Updates, migrations and backups: what an update changes, what it never touches, and how migrations run.
Themes
- Theme development: folder layout,
theme.json, templates, partials, assets and pagination. - Theme reference: variables and helpers: every template variable and helper function.
- Customizer options, menus and widgets: options as CSS variables, menu locations, widget areas and
boot.php. - SEO, dates and images in themes: what core prints for you, and how to show dates and responsive images.
- Tutorial: Build a theme from scratch.
Apps
- App development: the manifest, the entry class,
boot(), lifecycle methods, settings, tables and packaging. - Hooks and filters: every core action and filter, with its arguments.
- The App API: posts, media, users, comments, terms, cache, mail, HTTP and scheduled tasks through
$this->api(). - Admin screens, routes and UI components:
adminGet(), access, CSRF, flash messages and the admin's components. - AJAX actions: browser actions with CSRF, capability, input and rate-limit checks built in.
- App permissions: declaring, approving and enforcing what an app may touch.
- Content types, blocks and widgets: extend the content model and the editor.
- Tutorials: Build your first app, Add a "Was this helpful?" widget with AJAX, Import an RSS feed on a schedule.
API and AI agents
- REST API guide: API keys, JWT, scopes, responses, errors and examples in curl, JavaScript, PHP and Python.
- API reference: every REST, OAuth and MCP endpoint, with the scope each needs.
- MCP and AI agents: how assistants connect, the tools they get, and how roles limit them.
- AI discovery: llms.txt, robots.txt and WebMCP: what Basehim publishes for crawlers and in-browser agents.
- Tutorials: Publish from a script with the REST API, Connect an AI assistant to your site, Give your app an MCP tool.
Security and contributing
- Security for developers: roles and capabilities, filtered HTML, CSRF, escaping, uploads, rate limits and tokens.
- Contributing and running the tests: the test suite, code conventions, migrations and pull requests.
Can't find it?
Try the search, browse the tutorials, or read the release notes on the blog. The source code is on GitHub.