Developer docs
Guides and reference for developers building on Basehim: themes, apps, the REST API and AI agents.
Running a website rather than building on Basehim? The Guide covers installing and running your site, step by step, with no code.
New to developing for Basehim? Read the Developer overview, then follow Build your first app or Build a theme from scratch. All step-by-step projects are on the Tutorials page. Building with an AI assistant? Start with Build with AI, or connect one to your site with Basehim Dev Tools.
Start
- Developer overview: themes, apps and the API, how a request flows, and a local setup in five minutes.
- Installing for development: your own computer, full requirements, Apache and nginx rules, table prefixes and a real cron job.
- 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.
Build with AI
- Basehim Dev Tools: install it from the Marketplace, connect an AI agent such as Claude, and let it build themes and apps, read logs and fix problems on your site, with checks and rollback on every change.
- Build with AI: three ways to work with an AI assistant (a chat, a coding agent, or an assistant connected to your site through MCP and Dev Tools), a safe step-by-step workflow, and what to check before going live.
- AI context for Basehim development: one compact page of rules and real API signatures to give your AI before it writes anything.
- Prompts for building with AI: ready-made prompts for apps, admin screens, AJAX, public pages, widgets, scheduled imports, uploads, MCP tools, themes, reviews, fixes and release notes.
Themes
- Theme development: folder layout,
theme.json, templates, partials, apps' pages, 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. - App development best practices: the complete guide to building safe, fast, trustworthy apps, from the manifest and migrations to permissions, security, UI, uploads, scheduled work, MCP tools, testing and a pre-release checklist.
- 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(). - Sending email from apps:
send(),sendTemplate(), themail.sendpermission and the mail hooks. - Admin bar for apps and themes: menus, live panels, badges, notices and quick-search results in the admin bar.
- Public routes for apps: an app's own pages and endpoints with
$this->router()->site(), per-route sign-in, CSRF and rate limits, pages in the active theme, and how conflicts with core are resolved. - Admin screens, routes and UI components:
adminGet(), access, CSRF, flash messages and the admin's components. - Dashboard widgets: cards an app adds to the admin dashboard, as data or HTML, with refresh and permissions.
- Data tables: add a column to the Posts, Pages, Comments or Apps list without replacing the screen, the fast prepare/render contract, declared row and bulk actions, and reusable cell components.
- AJAX actions: browser actions with CSRF, capability, input and rate-limit checks built in.
- Media and uploads for apps: file uploads through the AJAX gateway, private storage, adding to and replacing files in the media library, and hooks, filters and browser events on every upload.
- App permissions: declaring, approving and enforcing what an app may touch.
- Content types, blocks and widgets: extend the content model and the editor.
- Content types, taxonomies and custom fields: register your own kinds of content, with public pages, archives and fields.
- Search: how search works for core and apps, and how an app adds its own results.
- When an app fails: fault isolation and recovery: how core checks apps, switches off a broken one without taking the site down, and how to read its report and turn it back on.
- 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, public routes, 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.