@redskytech/provider-upload-imagekit

4.5.3 • Public • Published

@redskytech/provider-upload-imagekit

Resources

Links

Installation

# using yarn
yarn add @redskytech/provider-upload-imagekit

# using npm
npm install @redskytech/provider-upload-imagekit --save

Configuration

See the documentation about using a provider for information on installing and using a provider. To understand how environment variables are used in Strapi, please refer to the documentation about environment variables.

Provider Configuration

./config/plugins.js

module.exports = ({ env }) => ({
  // ...
  upload: {
    config: {
      provider: '@redskytech/provider-upload-imagekit',
      providerOptions: {
        access: {
          publicKey : env('IMAGEKIT_PUBLIC_KEY'),
          privateKey : env('IMAGEKIT_PRIVATE_KEY'),
          urlEndpoint : env('IMAGEKIT_URL_ENDPOINT'),
        },
        params: {
          pathPrefix: env('IMAGEKIT_PATH_PREFIX', ''),
        }
      }
    }
  },
  // ...
});

Security Middleware Configuration

Due to the default settings in the Strapi Security Middleware you will need to modify the contentSecurityPolicy settings to properly see thumbnail previews in the Media Library. You should replace strapi::security string with the object bellow instead as explained in the middleware configuration documentation.

./config/middlewares.js

module.exports = [
  // ...
  {
    name: 'strapi::security',
    config: {
      contentSecurityPolicy: {
        useDefaults: true,
        directives: {
          'connect-src': ["'self'", 'https:'],
          'img-src': [
            "'self'",
            'data:',
            'blob:',
            'dl.airtable.com',
            'yourImagekit.imagekit.com',
          ],
          'media-src': [
            "'self'",
            'data:',
            'blob:',
            'dl.airtable.com',
            'yourImagekit.imagekit.com',
          ],
          upgradeInsecureRequests: null,
        },
      },
    },
  },
  // ...
];

Readme

Keywords

Package Sidebar

Install

npm i @redskytech/provider-upload-imagekit

Weekly Downloads

1

Version

4.5.3

License

SEE LICENSE IN LICENSE

Unpacked Size

6.79 kB

Total Files

4

Last publish

Collaborators

  • gimp3695