Skip to content

Instantly share code, notes, and snippets.

@vojtechjurasek
Created April 14, 2020 14:11
Show Gist options
  • Save vojtechjurasek/ca1106af6af94b099b5428089c866923 to your computer and use it in GitHub Desktop.
Save vojtechjurasek/ca1106af6af94b099b5428089c866923 to your computer and use it in GitHub Desktop.
gatsby-config.js for Woocommerce and WordPress integration
require('dotenv').config()
module.exports = {
// ...
{
resolve: '@pasdo501/gatsby-source-woocommerce',
options: {
api: 'your-site.com',
https: true,
verbose: true,
query_string_auth: true,
api_keys: {
consumer_key: process.env.WOOCOMMERCE_CONSUMER_KEY,
consumer_secret: process.env.WOOCOMMERCE_CONSUMER_SECRET,
},
fields: ['products'],
},
},
{
resolve: 'gatsby-source-wordpress',
options: {
baseUrl: 'your-site.com',
protocol: 'https',
hostingWPCOM: false,
useACF: true,
verboseOutput: true,
},
},
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment