1.0.1 • Published 7 months ago

@cosmo.chang1701/strapi-provider-upload-vercel-blob v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

@cosmo.chang1701/strapi-provider-upload-vercel-blob

Installation

yarn add @cosmo.chang1701/strapi-provider-upload-vercel-blob

Usage

Configuration

To configure the provider, update your Strapi project's config/plugins.js file:

export default ({ env }) => ({
  upload: {
    config: {
      provider: '@cosmo.chang1701/strapi-provider-upload-vercel-blob',
      providerOptions: {
        accessToken: env('BLOB_READ_WRITE_TOKEN'),
        pathname: env('BLOB_PATHNAME'),
      },
      actionOptions: {
        upload: {},
        uploadStream: {},
        delete: {},
      },
    },
  },
})

Environment Variables

Ensure the following values are set in your environment variables:

  • BLOB_READ_WRITE_TOKEN - Your Vercel Blob access token.
  • BLOB_PATHNAME - The directory for storing uploaded files in the Vercel Blob Store.

Security Middleware Configuration

To comply with security policies, update config/middlewares.js as follows:

module.exports = [
  // ...
  {
    name: 'strapi::security',
    config: {
      contentSecurityPolicy: {
        useDefaults: true,
        directives: {
          'connect-src': ["'self'", 'https:'],
          'img-src': [
            "'self'",
            'data:',
            'blob:',
            'market-assets.strapi.io',
            'yourVercelBlobStoreId.public.blob.vercel-storage.com',
          ],
          'media-src': [
            "'self'",
            'data:',
            'blob:',
            'market-assets.strapi.io',
            'yourVercelBlobStoreId.public.blob.vercel-storage.com',
          ],
          upgradeInsecureRequests: null,
        },
      },
    },
  },
  // ...
]

License

This project is licensed under the MIT License.

1.0.1

7 months ago