Every OpenDash capability — database KV, outbound SSRF-pinned HTTP, lifecycle hooks, custom HTTP endpoints, dashboard widgets, cron tasks, and encrypted secrets — must be declared explicitly inside manifest.json and enforced by the host runtime.
Least-Privilege Permissions & Destructive Guardrails
Declare exact grants inside permissions: sqlite (kv_read, kv_write), http / structured network allowlists (scheme/host/port/methods/path prefix), content_read|write|delete per CPT, explicit content_read_private|write_private (wildcard "*" forbidden), taxonomy_read, media_read, site_options_read, plugin_settings_read, and explicit secret key arrays in plugin_secrets_read.
- Lifecycle Permissions (Schema 3,
min_host_version >= "0.1.1"):content_trash_read,content_restore, and Admin-onlycontent_purgeenforce strict safeguards: actions cannot combine multiple write scopes (ERR_MIXED_WRITE_SCOPE),content_restore/content_purgecannot combine outboundhttp, andcontent_purgealways requires explicit one-time Host Confirmation (409 confirmation_required, 120s TTL).
Hooks, Filters, Projections & Cron Jobs
- Lifecycle Hooks: Synchronous veto gate
content/before_saveplus post-commit async hooks (content/after_save,content/after_delete,content/after_publish,content/after_unpublish,contact/after_submit,plugin/after_enable|disable,settings/after_save,theme/after_activate). - Synchronous Filters:
filter:content/prepare_save,filter:contact/before_submit(HTTP 422 veto),filter:seo/head,filter:entry/view, and public template hooksfilter:render/head,filter:render/footer, andfilter:render/slotbacked byExtensionRenderCache(render_cache: "by_route" | "global" | "none"). - Write-Time Projections: Computed once at publish/enable time into
plugin_entry_projectionsunder precedence Admin > Plugin > Theme, keeping public GET at 0 worker spawns for entry projections while preservingfinal_noindex = core_noindex || plugin_noindex. - Scheduled Cron Jobs (
<= 8per plugin): Declare{ id, schedule, description }undercronusing 5-field expressions, query schedule history atGET /api/admin/plugins/{id}/cron, and trigger on-demand runs viaPOST /api/admin/plugins/{id}/cron/{job_id}/run.
Scoped Custom Routes (<= 32 per Plugin)
Declare HTTP GET or POST handlers in routes without overlapping core namespaces. OpenDash exposes them strictly under your package prefix across three surfaces:
/p/{pkg}/*&/api/public/p/{pkg}/*foraccess: "public"(strict Origin on POST) oraccess: "webhook"(POST-only raw body, allowlisted HMAC headers, rate limited;content_save/content_deletedenied)./api/p/{pkg}/*for authenticatedaccess: "session"oraccess: "admin"calls.
Declarative Admin UI & SecretStore
Plugins extend Admin using typed declarations (never arbitrary Admin scripts):
admin_extensions(manifest_schema >= 2): Add up to16custom tablecolumnsper owner (text,badge,link;32effective cap) and up to8dashboard_widgetsper owner (stat,list,status,action;24effective cap) with role gating.settings_schema&SecretStore: Declare up to64OwnerSettings fields (including write-onlytype: "secret"). Plaintext secrets stay out of SQLite inside encrypted-at-ops0600files underdatabase/secrets/plugins/<id>/<64-hex>.json(max4096 B);GET /api/admin/plugins/{id}/settingsreturns only{"configured": bool}and{"clear": true}deletes the secret cleanly.
{
"id": "acme-sync",
"name": "Acme Sync",
"version": "1.0.0",
"api_version": 1,
"manifest_schema": 3,
"min_host_version": "0.1.1",
"entrypoint": "plugin.js",
"hooks": ["content/after_publish"],
"filters": ["filter:render/footer"],
"routes": [
{ "id": "hook_in", "method": "POST", "path": "/webhook", "access": "webhook" }
],
"cron": [
{ "id": "nightly_sync", "schedule": "0 2 * * *", "description": "Sync nightly items" }
],
"admin_extensions": {
"schema_version": 1,
"dashboard_widgets": [
{ "local_key": "sync_status", "title": "Sync Health", "kind": "status", "required_role": "admin" }
]
},
"settings_schema": [
{ "key": "webhook_secret", "label": "Webhook Secret", "type": "secret" }
],
"permissions": {
"sqlite": ["kv_read", "kv_write"],
"content_read": ["post"],
"plugin_settings_read": true,
"plugin_secrets_read": ["webhook_secret"]
}
}
Next Steps
- Automate content and site workflows with AI via Built-in MCP & API.
- Review CLI commands and offline test helpers in Create, Test & Package Your First Plugin.