|
1 |
| -# netlify-plugin-cloudinary |
| 1 | +# Cloudinary Netlify Plugin |
| 2 | + |
| 3 | +Optimize and serve all images served in your Netlify site deploy with [Cloudinary](https://cloudinary.com/). |
| 4 | + |
| 5 | +**This plugin is not officially supported by Cloudinary.** |
| 6 | + |
| 7 | +## ⚡️ Getting Started |
| 8 | + |
| 9 | +- Sign up for a free [Cloudinary](https://cloudinary.com/) account. |
| 10 | + |
| 11 | +- Install the plugin: |
| 12 | + |
| 13 | +```shell |
| 14 | +npm install netlify-plugin-cloudinary |
| 15 | +# or |
| 16 | +yarn add netlify-plugin-cloudinary |
| 17 | +``` |
| 18 | + |
| 19 | +- Add the plugin to your Netlify config: |
| 20 | + |
| 21 | +```toml |
| 22 | +[[plugins]] |
| 23 | + package = "netlify-plugin-cloudinary" |
| 24 | +``` |
| 25 | + |
| 26 | +- Configure your Cloudinary Cloud Name: |
| 27 | + |
| 28 | +```toml |
| 29 | +[[plugins]] |
| 30 | + package = "netlify-plugin-cloudinary" |
| 31 | + |
| 32 | + [plugins.inputs] |
| 33 | + cloudName = "[Your Cloud Name]" |
| 34 | +``` |
| 35 | + |
| 36 | +By default, your images will served via the [fetch delivery method](https://cloudinary.com/documentation/fetch_remote_images). |
| 37 | + |
| 38 | +## 🧰 Configuration |
| 39 | + |
| 40 | +### Setting your Cloud Name |
| 41 | + |
| 42 | +You have two options for setting your Cloud Name: plugin input or environment variable. |
| 43 | + |
| 44 | +**Input** |
| 45 | + |
| 46 | +Inside your Netlify config: |
| 47 | + |
| 48 | +```toml |
| 49 | + [plugins.inputs] |
| 50 | + cloudName = "[Your Cloud Name]" |
| 51 | +``` |
| 52 | + |
| 53 | +**Environment Variable** |
| 54 | + |
| 55 | +Inside your environment variable configuration: |
| 56 | + |
| 57 | +``` |
| 58 | +CLOUDINARY_CLOUD_NAME="[Your Cloud Name]" |
| 59 | +``` |
| 60 | + |
| 61 | +Learn how to [set environment variables with Netlify](https://docs.netlify.com/configure-builds/environment-variables/). |
| 62 | + |
| 63 | +### Changing your Delivery Method |
| 64 | + |
| 65 | +**fetch** |
| 66 | + |
| 67 | +Default - no additional configuration needed. |
| 68 | + |
| 69 | +Learn more about using delivering remote images with [fetch](https://cloudinary.com/documentation/fetch_remote_images). |
| 70 | + |
| 71 | +**upload - Unsigned** |
| 72 | + |
| 73 | +Unsigned uploads require an additional [Upload Preset](https://cloudinary.com/documentation/upload_presets) set up and configured in your Cloudinary account. |
| 74 | + |
| 75 | +Inside your Netlify config: |
| 76 | + |
| 77 | +```toml |
| 78 | +[[plugins]] |
| 79 | + package = "netlify-plugin-cloudinary" |
| 80 | + |
| 81 | + [plugins.inputs] |
| 82 | + cloudName = "[Your Cloudinary Cloud Name]" |
| 83 | + deliveryMethod = "upload" |
| 84 | + uploadPreset = "[Your Cloudinary Upload Preset]" |
| 85 | +``` |
| 86 | + |
| 87 | +Learn more about [unsigned uploads](https://cloudinary.com/documentation/upload_images#unsigned_upload). |
| 88 | + |
| 89 | +**upload - Signed |
| 90 | + |
| 91 | +Signed uploads require you to set your API Key and API Secret as environment variables. |
| 92 | + |
| 93 | +Inside your Netlify config: |
| 94 | + |
| 95 | +```toml |
| 96 | +[[plugins]] |
| 97 | + package = "netlify-plugin-cloudinary" |
| 98 | + |
| 99 | + [plugins.inputs] |
| 100 | + cloudName = "[Your Cloudinary Cloud Name]" |
| 101 | + deliveryMethod = "upload" |
| 102 | +``` |
| 103 | + |
| 104 | +Inside your environment variable configuration: |
| 105 | + |
| 106 | +``` |
| 107 | +CLOUDINARY_API_KEY="[Your Cloudinary API Key]" |
| 108 | +CLOUDINARY_API_SECRET="[Your Cloudinary API Secret]" |
| 109 | +``` |
| 110 | + |
| 111 | +Learn more about [signed uploads](https://cloudinary.com/documentation/upload_images#uploading_assets_to_the_cloud). |
0 commit comments