npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

strapi-provider-upload-vercel-blob

v1.1.2

Published

Strapi upload provider for Vercel Blob storage

Readme

strapi-provider-upload-vercel-blob

Upload media from Strapi directly to Vercel Blob storage.


Why this package?

Vercel Blob gives you edge-cached, globally distributed file storage with a simple SDK. This provider plugs it into Strapi's upload system so every image, video, or document you add through the Media Library ends up in your blob store automatically.


Quick start

npm install strapi-provider-upload-vercel-blob

Add your Vercel Blob token to .env:

VERCEL_BLOB_TOKEN=vercel_blob_rw_xxxxxxxxxxxxx

Create (or update) config/plugins.ts:

export default ({ env }) => ({
  upload: {
    config: {
      provider: "strapi-provider-upload-vercel-blob",
      providerOptions: {
        token: env("VERCEL_BLOB_TOKEN"),
      },
    },
  },
});

That's it — uploads now go to Vercel Blob.


Options

All fields are optional. Sensible defaults are applied when omitted.

| Name | Type | Default | Description | | --- | --- | --- | --- | | token | string | BLOB_READ_WRITE_TOKEN env var | Vercel Blob read-write token. | | addRandomSuffix | boolean | true | Append a random suffix to blob paths to avoid collisions. | | cacheControlMaxAge | number | 31536000 (1 year) | Edge and browser cache lifetime in seconds. | | maxUploadSizeMB | number | 500 | Reject files larger than this (in MB). |

Full example with every option:

export default ({ env }) => ({
  upload: {
    config: {
      provider: "strapi-provider-upload-vercel-blob",
      providerOptions: {
        token: env("VERCEL_BLOB_TOKEN"),
        addRandomSuffix: false,
        cacheControlMaxAge: 60 * 60 * 24 * 30, // 30 days
        maxUploadSizeMB: 100,
      },
    },
  },
});

Strapi security middleware

Strapi's default CSP blocks images from external origins. You need to allow your blob store's domain so thumbnails show up in the Media Library.

In config/middlewares.ts, replace the "strapi::security" string with:

export default [
  // …keep your other middlewares
  {
    name: "strapi::security",
    config: {
      contentSecurityPolicy: {
        useDefaults: true,
        directives: {
          "connect-src": ["'self'", "https:"],
          "img-src": [
            "'self'",
            "data:",
            "blob:",
            "https://<STORE_ID>.public.blob.vercel-storage.com",
          ],
          "media-src": [
            "'self'",
            "data:",
            "blob:",
            "https://<STORE_ID>.public.blob.vercel-storage.com",
          ],
          upgradeInsecureRequests: null,
        },
      },
    },
  },
];

Replace <STORE_ID> with the subdomain shown in your Vercel Blob dashboard.


Development

Prerequisites

  • Node.js ≥ 18
  • npm

Setup

git clone <repo-url>
cd strapi-provider-upload-vercel-blob
npm install

Scripts

| Command | What it does | | --- | --- | | npm run build | Compile TypeScript → dist/ | | npm run dev | Compile in watch mode | | npm run typecheck | Type-check without emitting | | npm test | Run unit tests (mocked, no network) | | npm run test:coverage | Unit tests with V8 coverage report | | npm run test:e2e | Run end-to-end tests against a real Vercel Blob store |

Running e2e tests

The e2e suite uploads and deletes real blobs. You need a token:

  1. Copy .env.test and fill in your token:
    BLOB_READ_WRITE_TOKEN=vercel_blob_rw_xxxxxxxxxxxxx
  2. Run:
    npm run test:e2e

Project structure

src/
  types.ts         — ProviderConfig, StrapiFile, and StrapiUploadProvider interfaces
  blob-client.ts   — BlobStorageClient class wrapping the Vercel Blob SDK
  validation.ts    — File-size assertion and body extraction helpers
  index.ts         — Provider entry point (init → StrapiUploadProvider)
tests/
  helpers.ts       — Shared mock factories for tests
  validation.test.ts
  blob-client.test.ts
  index.test.ts
  e2e/
    upload.test.ts — Real upload / download / delete against Vercel Blob

License

MIT