API Reference
Complete API documentation for WP Kernel.
Core Modules
Resources
Define typed REST resources with automatic client generation, store integration, and cache management.
Policies
Declarative capability rules with caching, denial events, and React helpers for UI gating.
Reporter
Structured logging via LogLayer with console and WordPress hook transports.
Data Helpers
Registry utilities (registerKernelStore
) and notice bridging for @wordpress/data
stores. configureKernel()
is the bootstrap function available from @wpkernel/core
.
Errors
Error types and handling primitives.
HTTP Transport
UI Hooks
usePrefetcher
React adapters around resource prefetching helpers (prefetchGet
/ prefetchList
) plus utility hooks for hover, visibility, and pagination prefetch flows.
useAction
Thin React wrapper over kernel Actions with concurrency controls, deduping, and automatic cache invalidation.
CLI Reference
The CLI package now ships with the same JSDoc-driven reference used for the kernel. Browse the generated Markdown under /api/generated
to explore runCli
, command classes, policy-map helpers, and typed configuration artifacts for @wpkernel/cli
.
UI Reference
Typed documentation for @wpkernel/ui
is published alongside the kernel and CLI references. The generated pages cover runtime attachment helpers, hooks, and DataViews integration utilities so the three packages share a consistent API narrative.
Coming Soon
The following modules are planned for future sprints:
- Actions - Write operation orchestration (Sprint 3)
- Jobs - Background task management (Sprint 2)
- Events - Hook system integration (Sprint 2)
Usage
import { defineResource, invalidate } from '@wpkernel/core';
import { KernelError, ServerError } from '@wpkernel/core/error';
import { fetch } from '@wpkernel/core/http';
For detailed examples and tutorials, see the Guide.