diff --git a/www/docs/content/plugins/file-service/s3.mdx b/www/docs/content/plugins/file-service/s3.mdx index d8e0b7e7ed..3806c14da4 100644 --- a/www/docs/content/plugins/file-service/s3.mdx +++ b/www/docs/content/plugins/file-service/s3.mdx @@ -104,29 +104,7 @@ In the directory of your Medusa backend, run the following command to install th npm install medusa-file-s3 ``` -Then, add the following environment variables: - -```bash -S3_URL= -S3_BUCKET= -S3_REGION= -S3_ACCESS_KEY_ID= -S3_SECRET_ACCESS_KEY= -S3_CACHE_CONTROL= -S3_DOWNLOAD_FILE_DURATION= -``` - -Where: - -1. `` is the URL to your bucket. It’s in the form `https://.s3..amazonaws.com`, where `` is the name of the bucket and the `` is the region the bucket is created in. If you’re not sure which region, on your bucket’s page on S3 click on Properties. You can then find the region under AWS Region. Make sure to only copy the code (for example, `us-east-1`). -2. `` is the name of the bucket you created. -3. `` is the region code of your bucket. For example, `us-east-1`. -4. `` is the Access Key ID that you created for your user. -5. `` is the Secret Access Key that you created for your user. -6. `` is the value for caching the objects in a web browser or CDN network. For example: cache object for 10 hours, `max-age=36000` -7. `` is the expiry duration for a download URL. For example, you can set the value to ``3600`` if you want the download URL to expire in 1 hour. - -Finally, in `medusa-config.js`, add to the `plugins` array the following new item: +Then, in `medusa-config.js`, add to the `plugins` array the following new item: ```jsx title=medusa-config.js const plugins = [ @@ -147,6 +125,28 @@ const plugins = [ ] ``` +Where: + +1. `s3_url` (required) is the URL to your bucket. It’s in the form `https://.s3..amazonaws.com`, where `` is the name of the bucket and the `` is the region the bucket is created in. If you’re not sure which region, on your bucket’s page on S3 click on Properties. You can then find the region under AWS Region. Make sure to only copy the code (for example, `us-east-1`). +2. `bucket` (required) is the name of the bucket you created. +3. `region` (required) is the region code of your bucket. For example, `us-east-1`. +4. `access_key_id` (required) is the Access Key ID that you created for your user. +5. `secret_access_key` (required) is the Secret Access Key that you created for your user. +6. `cache_control` (default: `max-age=31536000`) is the value for caching the objects in a web browser or CDN network. For example: cache object for 10 hours, `max-age=36000` +7. `download_file_duration` (optional) is the expiry duration for a download URL. For example, you can set the value to ``3600`` if you want the download URL to expire in 1 hour. + +Make sure to also set these values in your environment variables as well: + +```bash +S3_URL= +S3_BUCKET= +S3_REGION= +S3_ACCESS_KEY_ID= +S3_SECRET_ACCESS_KEY= +S3_CACHE_CONTROL= +S3_DOWNLOAD_FILE_DURATION= +``` + :::caution