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 · Dec 6, 2026

vite-plugin-csp has 21,227 recorded weekly downloads on npm, a decrease of 11.0% over the past 30 days, ranking #1021 of 3,247 tracked listings.

Weekly downloads
21,227
Official API · Dec 5, 2026
7-day growth
-3.5%
-778 weekly downloads
30-day growth
-11.0%
-2.6K weekly downloads
90-day growth
+11.4%
+2.2K weekly downloads
Rank
#1021
▼ 29 in 7 days

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: 21,227 weekly downloads as of Dec 5, 2026, +11.4% over 90 days.vite-plugin-cspWeekly downloads on npm · Last 90 days21,227downloads / week+11.4% over 90 days05K10K15K20K25K30KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
vite-plugin-csp weekly downloads on npm, last 90 days: 21,227 weekly downloads as of Dec 5, 2026, +11.4% over 90 days.

7/30/90-day growth

vite-plugin-csp weekly downloads growth on npm: -3.5% over 7 days, -11.0% over 30 days, +11.4% over 90 days.vite-plugin-cspWeekly downloads growth on npm21,227downloads / week now7-day growth-778 weekly downloads-3.5%30-day growth-2,615 weekly downloads-11.0%90-day growth+2,169 weekly downloads+11.4%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
vite-plugin-csp weekly downloads growth on npm: -3.5% over 7 days, -11.0% over 30 days, +11.4% over 90 days.

Ranking history

vite-plugin-csp npm ranking history: currently #1021 (by weekly downloads).vite-plugin-cspnpm ranking · by weekly downloads · Last 90 days#1021current rank#300#400#500#600#700#800#900#1000#1100Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 17, 2026 – Dec 6, 2026 · 45 observations · Updated Dec 5, 2026pluginstats.com
vite-plugin-csp npm ranking history: currently #1021 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,083 shown · page 52, #1 (overall #1,021)
All npm: every listing in weekly downloads order

Listing placement

Vite plugins300 listings · 15 pages · page 9, #19 (overall #179)
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 (591)
Recent weekly downloads observations for vite-plugin-csp
Date (UTC)Weekly downloadsChange vs. previous
21,227-254
21,481+591
20,890+857
20,033-332
20,365-360
20,725-724
21,449-556
22,005-748
22,753-2.3K
25,088-2.1K
27,198-984
28,182+1.3K
26,908+605
26,303—

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 Dec 6, 2026. See the methodology.