0.0.1 • Published 2 years ago

@shaunpearce/strapi-provider-upload-imagekit v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

strapi-provider-upload-imagekit

version v4.0.2

Notes

ImageKit provider for the Strapi Upload plugin

  • Current version: 4.0.2
  • Compatible with Strapi version: ^4.0.0
    • Latest tested version 4.0.7

:exclamation: MAYOR and MINOR versions of the provider are representing compatability with Strapi, while the PATCH version is used to denote changes in the provider itself.

:exclamation: For Strapi v3 please use v0.2.5 of this provider.

Installation

1. Install via npm or yarn

npm install strapi-provider-upload-imagekit --save

or

yarn add strapi-provider-upload-imagekit

2. Add or modify the plugins configuration file

Global configuration file is located in ./config/plugins.js

Environment configuration files are located in ./config/env/{env}/plugins.js

For more information please check the official documentation.

3. Add your configuration

Example ./config/plugins.js:

module.exports = ({ env }) => ({
  upload: {
    config: {
      provider: "strapi-provider-upload-imagekit",  // Community providers need to have the full package name
      providerOptions: {
        publicKey: "publicKey",
        privateKey: "privateKey",
        urlEndpoint: "urlEndPoint",  // Example: https://ik.imagekit.io/username

        // Optional
        params: {
          folder: "/production/images"  // Defaults to "/" if value is not supplied
        }
      }
    }
  }
});

4. Setting up strapi::security middlewares to prevent contentSecurityPolicy URL blocking

Modify ./config/middleware.js:

// ...
{
    name: 'strapi::security',
    config: {
      contentSecurityPolicy: {
        useDefaults: true,
        directives: {
          'connect-src': ["'self'", 'https:'],
          'img-src': ["'self'", 'data:', 'blob:', 'ik.imagekit.io'],
          'media-src': ["'self'", 'data:', 'blob:', 'ik.imagekit.io'],
          upgradeInsecureRequests: null,
        },
      },
    },
},
// ...

Resources

Links

Imagekit links