Proxied cookie-authenticated REST API requests to WordPress.com. Current stable version is 7.0.7, released under the Automattic/wp-calypso monorepo with irregular release cadence. Uses a proxy to authenticate requests with browser cookies, ideal for WordPress.com OAuth-less integrations. Key differentiator from wpcom-xhr-request: simpler setup with automatic cookie handling, but only works in browser environments.
npm install wpcom-proxy-requestNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates making a GET request to WordPress.com REST API with cookie-based authentication via proxy.
Use import instead of require, or upgrade to Node.js 14+ for ESM support.
Use wpcom-xhr-request or wpcom-oauth for server-side.
Use apiVersion: '1.1' or newer.
Ensure the request originates from a WordPress.com page or a site with the proxy enabled.
Use import wpcomProxyRequest from 'wpcom-proxy-request'.
Make sure the code runs on a WordPress.com page or a page that includes the proxy script.
Ensure user is logged into WordPress.com and has appropriate permissions.