Skip to content
Arun Prakash edited this page Nov 3, 2026 · 18 revisions

wordpress_client

A strongly typed WordPress client for Dart and Flutter. It talks to the REST API, WPGraphQL and the Abilities API through one client, one auth setup and one middleware pipeline.

final client = WordpressClient.forSite(siteUrl: Uri.parse('https://example.com'));
final posts = (await client.posts.list(ListPostRequest(perPage: 5))).dataOrThrow();

Start here

Page What it covers
Usage Install, create a client, discovery, lifecycle
Bootstrap and Configuration Every BootstrapBuilder option, reconfigure, origin rules
Authorization App Passwords, JWT, custom auth, credential handling
Browser Sign-In Let users approve your app on their site (authorize-application flow)
WordPress.com and Jetpack forWordpressCom, OAuth2 tokens
Multisite forNetworkSite, siteUrl
Sending Requests CRUD, request options, media upload, response metadata
Supported REST Methods Endpoint and operation coverage

Working with data

Page What it covers
Error Handling and Responses Success/failure, typed failures, RequestErrorType
Fluent Queries client.posts.query.withSearch(...).execute()
Interfaces and Extensions getById, findBySlug, listAll, model helpers
Custom Post Types client.resource<T> for custom post types and plugin routes
Model Generator dart run wordpress_client:generate: models from the REST schema
Meta and ACF metaValue<T>, acfValue<T>, acf: on writes
Concurrent Edits updateIfUnmodified
Batch Requests Many writes in one HTTP call
Embed and Fields _embed / _fields, typed post.embedded
Pagination and Finders listPages, listAll, finders
Parallel Requests Fetch many pages concurrently
Streaming and Polling Poll a resource as a Stream
Pattern Directory Items The block pattern directory endpoint

Behaviour

Page What it covers
Retries RetryPolicy, backoff, Retry-After
Caching GET cache, invalidation, ETag revalidation, persistent and custom stores
Request De-duplication and Concurrency Share identical in-flight GETs, cap parallel requests
Middlewares onRequest / onExecute / onResponse hooks
Logging LoggingMiddleware with redaction
Offline Write Queue Keep writes made offline and replay them
Events and Statistics Per-request events (onSend, onReceive, onError, onCancel), request counters

Other APIs

Page What it covers
GraphQL Queries, mutations, partial results, pagination, batching, APQ
Abilities WordPress 6.9 Abilities API

Extending and testing

Page What it covers
Using Custom Requests Typed interfaces for your own endpoints
Raw Requests Untyped requests and responses
Integration with Storage Packages Persisting responses and cache entries
Testing MockWordpressAdapter
API Changelog Breaking changes and migration notes

Clone this wiki locally