Source plugin for Gatsby. Pulls in data from protected routes via the WooCommerce REST API with credentials.
Source plugin for Gatsby. Pulls in data from protected routes via the WooCommerce REST API with credentials.
npm i --save @massivdash/gatsby-source-woocommerce
// In gatsby-config.js
plugins:[
{
resolve: "@massivdash/gatsby-source-woocommerce",
options: {
// Base URL of Wordpress site
api: 'wordpress.domain',
// This counts controls the API get with ?per_page=
// default: 10
itemCount: 20,
// set to true to see fetch output in console, during build
// default: false
verbose: true,
// true if using https. false if nah.
https: false,
api_keys: {
consumer_key: <key>,
consumer_secret: <secret>,
},
// Array of strings with fields you'd like to create nodes for...
fields: ['products']
}
}
]
This is fork from https://registry.npmjs.org/gatsby-source-woocommerce/
03.03. 2019 Added support for page pagination via ?per_page= request for displaying more than 10 products in a single call.
09.03.2019 Added verbose output to console for details while fetching nodes. Updated packages