An isomorphic JavaScript client for interacting with the WordPress REST API
npm install wpapiA WordPress REST API client for JavaScript
==========================================
This library is an isomorphic client for the WordPress REST API, designed to work with WordPress 5.0 or later. If you are using the older WP REST API plugin or WordPress 4.9, some commands will not work.


Index:
- About
- Installation
- Using the Client
- Auto-Discovery
- Creating Posts
- Updating Posts
- Requesting Different Resources
- API Query Parameters & Filtering Collections
- Uploading Media
- Custom Routes
- Setter Method Naming
- Query Parameters & Filtering
- Mixins
- Embedding Data
- Collection Pagination
- Customizing HTTP Request Behavior
- Specifying HTTP Headers
- Authentication
- API Documentation
- Issues
- Contributing
node-wpapi is an isomorphic JavaScript client for the WordPress REST API that makes it easy for your JavaScript application to request specific resources from a WordPress website. It uses a query builder-style syntax to let you craft the request being made to REST API endpoints, then returns the API's response to your application as a JSON object. And don't let the name fool you: with Webpack or Browserify, node-wpapi works just as well in the browser as it does on the server!
This library is maintained by K. Adam White at Bocoup, with contributions from a great community of WordPress and JavaScript developers.
To get started, npm install wpapi or download the browser build and check out "Installation" and "Using the Client" below.
node-wpapi works both on the server or in the browser. Node.js version 8.6 or higher (or version 8.2.1 with the --harmony flag) is required, and the latest LTS release is recommended.
In the browser node-wpapi officially supports the latest two versions of all evergreen browsers, and Internet Explorer 11.
To use the library from Node, install it with npm:
``bash`
npm install --save wpapi
Then, within your application's script files, require the module to gain access to it:
`javascript`
var WPAPI = require( 'wpapi' );
This library is designed to work in the browser as well, via a build system such as Browserify or Webpack; just install the package and require( 'wpapi' ) from your application code.
Alternatively, you may download a ZIP archive of the bundled library code. These files are UMD modules, which may be included directly on a page using a regular