The official JavaScript library for the WordPress.com REST API, version 7.1.1. It provides a comprehensive client for interacting with WordPress.com sites, including posts, media, comments, and user data. Built with modern JavaScript, it ships TypeScript definitions and supports both ESM (ES Modules) and CommonJS. Released actively alongside the WordPress.com platform, it is the recommended client for WordPress.com API integration, offering methods that return Promises and support for OAuth2 authentication. Its key differentiator is direct support and maintenance by Automattic, ensuring compatibility with WordPress.com's REST API endpoints.
npm install wpcomNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes a WPCOM client, fetches site info, and creates a new post using async/await.
Use .then() or async/await instead of callback functions.
Use import WPCOM from 'wpcom' or const WPCOM = require('wpcom').default.Use new WPCOM({ token: '...' }) or upgrade to OAuth2 client.Generate an API token from your WordPress.com developer settings.
Always call .get() or .add() etc. to execute the request.
Use import WPCOM from 'wpcom' or const WPCOM = require('wpcom').default;Use .then() or async/await instead of passing a callback.
Generate a new token from your WordPress.com developer settings and ensure it's passed correctly.
No dependency data recorded yet.