Source plugin for Gatsby. Pulls in data from protected routes via the WooCommerce REST API with credentials.
npm install --save gatsby-source-woocommerce
// In gatsby-config.js
plugins:[
{
resolve: "gatsby-source-woocommerce",
options: {
// Base URL of Wordpress site
api: 'wordpress.domain',
// 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']
}
}
]
- Products
- Customers
- Orders
- Reports
- Coupons