Automatically purge Cloudflare cache on Netlify deploy.
npm install netlify-purge-cloudflare-on-deploy#### API TOKEN - Instructions for creating new Cloudflare API Token
1. In Cloudflare, navigate to My Profile --> API Tokens
2. Click Create Token Button
3. Click Custom Token Section --> Create Custom Token --> Get Started Button
4. On the Create Custom Token Page:
* Token Name --> Netlify Purge Cache Token (or anything other name that is meaningful to you)
* Permissions --> Zone --> Cache Purge --> Purge
* Click Continue to Summary button
5. Click Create Token Button
6. Record the API Token to your password safe of choice. This is the last time you will have an opportunity to see this token.
#### API TOKEN - Instructions for configuring Netlify
In Netlify, go to Settings -> Build & Deploy -> Environment -> Environment variables and set up:
* CLOUDFLARE_ZONE_ID
* CLOUDFLARE_API_TOKEN
#### API KEY - Instructions for finding your Cloudflare API Key
1. In Cloudflare, navigate to My Profile --> API Tokens
2. Below the API Tokens section, you will see the API Keys section
3. Click the View button to the right of Global API Key
4. Authenticate again using your CLoudflare account password and hCaptcha
5. Your API Key is revealed. No need to record this as you can access it anytime again in the future.
#### API KEY - Instructions for configuring Netlify
In Netlify, go to Settings -> Build & Deploy -> Environment -> Environment variables and set up:
* CLOUDFLARE_ZONE_ID
* CLOUDFLARE_API_KEY
* CLOUDFLARE_EMAIL
[[plugins]]
package = "./plugins/netlify-purge-cloudflare-on-deploy"