strapi-provider-upload-imagekit-io

4.1.3 • Public • Published

strapi-provider-upload-imagekit

version v4.1.3

Notes

ImageKit provider for the Strapi Upload plugin

  • Current version: 4.1.3
  • Compatible with Strapi version: ^4.1.3
    • Latest tested version 4.0.7

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.

❗ 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

Dependencies (1)

Dev Dependencies (1)

Package Sidebar

Install

npm i strapi-provider-upload-imagekit-io

Weekly Downloads

0

Version

4.1.3

License

MIT

Unpacked Size

6.58 kB

Total Files

6

Last publish

Collaborators

  • lucks