What problem does it solve?
HTML micro-apps often need persistent data, current-user identity, ownership, and permission control, but building a backend for each small app is impractical. This Skill provides a complete guide to MagicBase, a hosted database layer that gives micro-apps schema management, row-level CRUD, dynamic permissions, and current-user context without custom backend code.
Core Features & Use Cases
- Schema and Table Management: Create tables and columns with MySQL-like types (text, number, datetime, boolean, json) via agent tools, with automatic migration tracking in
.magicbase/migrations.json and MICRO-APP.md.
- Runtime Row Operations: Use
window.Magic.db inside HTML for queryRows, createRow, updateRow, deleteRow, filtering, sorting, pagination, and field projection against real table IDs.
- Identity and Permissions: Retrieve the current user with
window.Magic.getContext(), enforce creator-owned rows via system created_by, configure dynamic_permissions scopes (public, private_user, private_department, private_org), and gate administrator pages with getProjectAdminAccess().
- Use Case: Build a team todo app where everyone reads all tasks but only creators can edit or delete their own, with creator names displayed and admin-only statistics pages.
Quick Start
Ask the agent to create a MagicBase-backed todo micro-app where all team members can read tasks but only each task's creator can edit or delete it.