
Security News
PodRocket Podcast: Inside the Recent npm Supply Chain Attacks
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
@gravityforms/request
Advanced tools
Utility to make WordPress REST API requests. It's a wrapper around window.fetch.
Utility to make WordPress REST API requests. It's a wrapper around window.fetch
Install the module
npm install @gravityforms/request
Note: This package requires node
14.15.0 or later, and npm
6.14.8 or later. If needing support for IE11 make sure to include the fetch polyfill for that browser.
The request module abstracts away most of the pain of dealing with raw fetch.
Basic principles:
Required in gravityforms.config.js
in your project root:
module.exports = {
requestConfig: {
endpoints: {
get_something: {
path : '/wp-json/gf/v2/get_something',
rest_params: '',
nonce : null,
},
},
}
// other configs
}
Using the module:
import request from '@gravityforms/request';
const getSomething = async ( id ) => {
const other_stuff = getSomeStuff( id );
const response = await request( 'get_something', {
method: 'POST',
body: {
some_data: { stuff: 'here', },
other_stuff,
},
} );
console.log( response.data );
};
FAQs
Utility to make WordPress REST API requests. It's a wrapper around window.fetch.
We found that @gravityforms/request demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 11 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
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.