Skip to content
PluginStats

vite-plugin-csp weekly downloads statistics

By josh-hemphill · npm · Vite plugins

Create CSP meta tags and header configs from all sources in the final Vite html

View on npm Fresh · Oct 18, 2026

vite-plugin-csp has 11,651 recorded weekly downloads on npm, a decrease of 25.9% over the past 30 days, ranking #922 of 2,322 tracked listings.

Weekly downloads
11,651
Official API · Oct 18, 2026
7-day growth
-27.8%
-4.5K weekly downloads
30-day growth
-25.9%
-4.1K weekly downloads
90-day growth
-54.3%
-13.8K weekly downloads
Rank
#922
Among tracked npm listings

About vite-plugin-csp

CSP (Content-Security-Policy) Vite Plugin

<!-- cspell: disable bracketsstartstop -->

version NPM Codecov Libraries.io dependency status for latest release Rate on Openbase Test Release

Leverages csp-typed-directives to create typed CSP <meta> policies and validated interdependant headers. e.g. the CSP, CSP Report-Only, Report-To, and Referrer-Policy headers.

Mostly config compatible with csp-html-webpack-plugin

WARNING, STILL EARLY AND THINGS LIKE MODULE RESOLUTION ARE FINICKY

Now looking at making a multi-repo because this is going to require multiple layers of shared functionality and also built to an unplugin

Installation

Install the plugin with npm:

$ npm install --save-dev vite-plugin-csp
# Or shorthand
npm i -D vite-plugin-csp

Known issues

  • Relative modules are resolved relative to the CWD, not the file
  • no SSR support (and thus no nonce support)
  • No parsing of JS embeded sources (since that would require framework specific plugins)
  • Only script and style related directives are supported (except for the inclusion of report-to for generating headers)

Under construction :)

<!-- ## Zero Config Usage Add your base logo as `logo.png` file to your assets folder. Add the plugin to your vite config as follows: ```javascript const ViteCspPlugin = require('vite-plugin-csp') // or ESM import { ViteCspPlugin } from "module"; plugins: [ ViteCspPlugin() ] ``` ## Basic Usage <!-- [<svg alt="codesandbox" xmlns="http://www.w3.org/2000/svg" width="16" height="18"><path d="M7.219 15.877V9.394l-5.73-3.208v3.696l2.624 1.48v2.78l3.106 1.735zm1.488.038l3.163-1.773v-2.845l2.642-1.49V6.16l-5.805 3.26v6.496zm5.041-11l-3.05-1.72-2.68 1.512L5.32 3.193 2.241 4.937l5.744 3.215 5.763-3.237zM0 13.513V4.53L8 0l8 4.511V13.5l-8.001 4.484L0 13.513z" fill="currentColor"/></svg>](https://codesandbox.io/s/vite-plugin-csp-demo-uh195?file=/webpack.config.js) --> <!-- Add the plugin to your vite config as follows: ```javascript const ViteCspPlugin = require('vite-plugin-csp') // or ESM import { ViteCspPlugin } from "module"; ... plugins: [ ViteCspPlugin('/path/to/logo.png') // svg works too! ] ``` The default configuration will automatically generate webapp manifest files along with [44 different icon formats](https://github.com/josh-hemphill/vite-plugin-csp/tree/master/test/fixtures/expected/default) as appropriate for iOS devices, Android devices, Windows Phone and various desktop browsers out of your single `logo.png`. > **Tip:** You might want to [fine tune](#advanced-usage) what vendors to support. ### A Note on Path Resolution Under the hood, Vite/Rollup resolve the paths to the logo and favicons according to the following rules: * If `/path/to/logo` is absolute, there is nothing to resolve and the path specified is used as is. * If `./path/to/logo` is relative, it's resolved with respect to `process.cwd()`. ### HTML Injection In combination with [Vite's html plugin hooks](https://vitejs.dev/guide/api-plugin.html#transformindexhtml) it will also inject the necessary html for you:…

Description from the npm listing.

  • vite-plugin
  • CSP
  • CSPs
  • header
  • security
  • generate

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

vite-plugin-csp weekly downloads on npm, last 90 days: 11,651 weekly downloads as of Oct 18, 2026, -54.3% over 90 days.vite-plugin-cspWeekly downloads on npm · Last 90 days11,651downloads / week-54.3% over 90 days10K12K14K16K18K20K22K24K26KJul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18downloads / weekobservedarchived (Internet Archive)no observationsJul 22, 2026 – Oct 18, 2026 · 89 observations · Updated Oc…pluginstats.com
vite-plugin-csp weekly downloads on npm, last 90 days: 11,651 weekly downloads as of Oct 18, 2026, -54.3% over 90 days.

7/30/90-day growth

vite-plugin-csp weekly downloads growth on npm: -27.8% over 7 days, -25.9% over 30 days, -54.3% over 90 days.vite-plugin-cspWeekly downloads growth on npm11,651downloads / week now7-day growth-4,496 weekly downloads-27.8%30-day growth-4,076 weekly downloads-25.9%90-day growth-13,829 weekly downloads-54.3%Growth vs. nearest observation to each baseline date · Updated Oct 18, 2026pluginstats.com
vite-plugin-csp weekly downloads growth on npm: -27.8% over 7 days, -25.9% over 30 days, -54.3% over 90 days.

Ranking history

vite-plugin-csp npm ranking history: currently #922 (by weekly downloads).vite-plugin-cspnpm ranking · by weekly downloads · Last 90 days#922current rank#300#400#500#600#700#800#900#1000Jul 22Aug 6Aug 21Sep 5Sep 20Oct 5Oct 20rankOct 17, 2026 – Oct 20, 2026 · 4 observations · Updated Oct 18, 2026pluginstats.com
vite-plugin-csp npm ranking history: currently #922 (by weekly downloads).

Listing placement

All npm2,320 listings · 116 pages · 1,161 shown · page 47, #3 (overall #923)
All npm: every listing in weekly downloads order

Listing placement

Vite plugins253 listings · 13 pages · page 8, #9 (overall #149)
Vite plugins: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (543)
Recent weekly downloads observations for vite-plugin-csp
Date (UTC)Weekly downloadsChange vs. previous
11,651+1.2K
10,475-1.8K
12,244+222
12,022-5K
17,018-3.5K
20,5570
20,557+4.4K
16,147+606
15,541+541
15,000+203
14,797+155
14,642-1.4K
15,999-5.4K
21,349—

Similar npm Vite plugins plugins

All 20 vite-plugin-csp alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/vite-plugin-csp. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.