
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
wpcom-proxy-request
Advanced tools
Proxied cookie-authenticated REST-API and WP-API requests to WordPress.com
You likely want to use the high-level APIs in wpcom.js
instead of using this module directly.
This module offers access to the WordPress.com REST-API and WP-API via a proxying <iframe>
pointing to a special URL that proxies API requests on the host page's behalf.
It is intended to be used in the browser (client-side) via a bundler like browserify or webpack.
Install wpcom-proxy-request
using npm
:
npm install wpcom-proxy-request
// Import wpcom-proxy-request handler
import proxy from 'wpcom-proxy-request';
proxy( { path: '/me' }, function ( err, body, headers ) {
if ( err ) {
throw err;
}
const div = document.createElement( 'div' );
div.innerHTML = 'Your WordPress.com "username" is: <b>@' + res.username + '</b>';
document.body.appendChild( div );
} );
Compile and watch
client-test application
make watch-test-app
Run server
make run-test-app
Open a tab pointing to http://calypso.localhost:3001/
MIT – Copyright Automattic 2014
FAQs
Proxied cookie-authenticated REST API requests to WordPress.com.
The npm package wpcom-proxy-request receives a total of 1,465 weekly downloads. As such, wpcom-proxy-request popularity was classified as popular.
We found that wpcom-proxy-request demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.