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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@vercel/config

v0.0.24

Published

A TypeScript SDK for programmatically configuring Vercel projects

Downloads

2,230

Maintainers

sebastianromingsebastianromingcraigandrewscraigandrewsgkaragkiaourisgkaragkiaourisdglsparsonsdglsparsonsbvred4244bvred4244dummdidummdummdidummadriancooney_verceladriancooney_verceleveporcelloeveporcellohenryheffernanhenryheffernanbcorn-celybcorn-celydvoytenkodvoytenkocasey.gowriecasey.gowrieamyeganamyeganfalcoagustinfalcoagustinbrookemosbybrookemosbyfeugyfeugyswarnavasenguptaswarnavasenguptaraunofreibergraunofreibergmamusomamusogoncygoncysmaeda-kssmaeda-ksgargis5gargis5yvonnezhouyvonnezhouchibicodechibicodeandybitzandybitziamevilrabbitiamevilrabbittootallnatetootallnatestyflestyflematthewbinshtokmatthewbinshtokmglagolamglagolajavivelascojavivelascoluimeyluimeytimertimerlucleraylucleraymatheussmatheussanatrajkovskaanatrajkovskajooliashijooliashitimneutkenstimneutkenselsighelsighwitswitslpalmeslpalmescl3arglasscl3arglasssamsislesamsislechriswdmrchriswdmrrizbizkitsrizbizkitsismaelrumzanismaelrumzancreationixcreationixfeedthejimfeedthejimrauchgrauchghuozhihuozhialdoschaldoschlfadeslfadespaulogdmpaulogdmokbelokbeljerilynzjerilynzhedyzandihedyzandipadmaiapadmaiamsweeneydevmsweeneydevdelbadelbasokrasokragsandhugsandhudbredvickdbredvickhungrybearstudiohungrybearstudiocalebboydcalebboydhellojennifertranhellojennifertranmarcgreenstockmarcgreenstockagadzikagadziktknickmantknickmanjanoryjanoryjeffreyarnesonjeffreyarnesonmattjaredmattjaredmsimulcikmsimulcikgdbortongdbortoncorrettojscorrettojscramforcecramforcekakadiadarpankakadiadarpanmaxleitermaxleiterkit-fosterkit-fostertilly3gtilly3gtimeyoutakeittimeyoutakeitecklfecklfhealeycodeshealeycodesdferber90dferber90epallerolsepallerolsnicolas-webdevnicolas-webdevschlezschleznpm_bot_vercel_supportnpm_bot_vercel_supportpieparkerpieparkerjtaylor0196jtaylor0196javierbytejavierbyteemeraldsantoemeraldsantogaspar09gaspar09sr_internsr_internsebmarkbagesebmarkbagegudmundurgudmundurnick.traceynick.traceybmealeybmealeydoquedoqueaaorrisaaorrisnutanutadaniel.campbelldaniel.campbellquiibzquiibzchloe.tedderchloe.teddermjakobismjakobismehulkarmehulkaraaronbrown-vercelaaronbrown-verceltcc-sejohnsontcc-sejohnsonfiliphassonfiliphassonlubakravchelubakravchegnoffgnoffmatt.strakamatt.strakawbinnssmithwbinnssmithofhouseofhousemknichel-vercelmknichel-vercelvvovvovercel-release-botvercel-release-botrob-peters-vercelrob-peters-vercelgt-codesgt-codesbalazsorbanbalazsorbantobiaslinstobiaslinstiago-loureirotiago-loureirowyattjohwyattjohmbrakkenmbrakkentimolinstimolinsanthonyshewanthonyshewcmeyer_vercelcmeyer_verceltbremertbremermiguelalcaldemiguelalcaldelaugharnlaugharnviekoviekorobin-vercelrobin-vercelwude935wude935zach-baldazach-baldajchen-verceljchen-vercelah100101ah100101quietshuquietshuijjkijjkvercelbenvercelbenzharichzharichdfeindfeinonsclomonsclomashok.gurumurthyashok.gurumurthyowoceowoceshaper42shaper42ademauademaujeffsee55jeffsee55zeejabzeejabacdliteacdlitemcabs3mcabs3msemperemsemperekldavis4kldavis4lukahartwiglukahartwigbgwbgwsipexsipexjeremyphilemonjeremyphilemoneprosimoneprosimonrithmicrithmicdanmfoxdanmfoxn-vigiern-vigierbootstrap314bootstrap314vercelmattvercelmattjudegaojudegaovercel-ctatevercel-ctatealbanesealbanesesceilersceilerlgrammellgrammeljamesvclementsjamesvclementstomocchinotomocchinoaryamankhaaryamankhapranathippranathipjorgezreikjorgezreikmattfroggettmattfroggettmcociriomcocirioeps1loneps1lonpbzonapbzonamalewis5malewis5jlangelandjlangelanddevjiwonchoidevjiwonchoikonstvkonstvzacktannerzacktannergabenunezgabenunezshadcnshadcnmikecurtismikecurtisunstubbableunstubbablesueplexsueplexethansheaethansheaidoatvercelidoatvercelwentsulwentsulvikhyathvikhyathmischnicmischnichgstrmhgstrmdcampvc01dcampvc01mitul-smitul-sjonpheyjonpheyannagzhannagzhrich_harrisrich_harrisandrewbarbaandrewbarbabcjrobertsbcjrobertsmarc-vercelmarc-vercelali-vercelali-vercelduijfduijfplmrryplmrrytmdotmdojulianbenegasjulianbenegasrao.chandanrao.chandanthebigsadowskithebigsadowskigovind-vercelgovind-verceltomjohndesigntomjohndesignbshanzbshanzaubreychamberlainaubreychamberlainkmiddleton14kmiddleton14yavoryavor1st11st1fmoorfmoorvercel-eddievercel-eddietristantcoopertristantcooperyasoobr0yasoobr0m7rcelom7rceloestebansuarezestebansuareznpasquinzonpasquinzokobologkobologtimwhite96timwhite96astephen100astephen100matiasgfmatiasgflukesheardlukesheardadrientheboadrientheboelpranselpransolivercarmontolivercarmontjjdopkinjjdopkinadamdongadamdongrhyssullivanrhyssullivanvalerian-rochevalerian-rocheallen-vercelallen-vercelalli-vercelalli-vercelethsheaethsheascotttrinhscotttrinhjaclarkejaclarkebkonklebkonkleseverinlandoltseverinlandoltjaygengelbachjaygengelbachchriskindlchriskindlgschogschonsidnevnsidnevandyw22andyw22shagrawalshagrawalneil-vercelneil-vercelskullfaceskullfacefernandorojofernandorojokevin.corbettkevin.corbettzacowanzacowanjoelhooksjoelhookswillvileswillvilesmarkandrusmarkandrusloganliffickloganliffickyoungbloodcybyoungbloodcybestelle_wolskiestelle_wolskikapehe_okkapehe_okhaydenbleaselhaydenbleaselquuuquuujteesangjteesangpckirklandpckirklanddavid_keefedavid_keefejeffreypojeffreypoaormi-vercelaormi-verceldarafshehdarafshehmarkpython86markpython86lazarvlazarvtonypantonypanjackjacksonverceljackjacksonvercelseif.ghezalaseif.ghezalamiksumiksuwillsatherwillsatheramanazadamanazadjacobparisjacobparisicyjosephicyjosephwhatplanwhatplanvercelliotvercelliotlukesandberglukesandbergnicolasmontonenicolasmontonevoodootikigodvoodootikigodjustinkroppjustinkroppsatya-callstacksatya-callstackchristianhubbardchristianhubbardwoshuajolkwoshuajolkbennorbennorstranglestranglebmishkinbmishkinmshepaneshmshepaneshkarimhaseboukarimhasebouwilliamboutwilliamboutpranaygppranaygpalex-groveralex-groverchrmcd-verchrmcd-verallenzhou101allenzhou101dmoridmoriiansbrashiansbrashalice-wonderedalice-wonderedmatchaimatchaivishalyathishvishalyathishsamselikoffsamselikoffmrsasuu_ckmrsasuu_ckmtoth-vercelmtoth-vercelanshuman71anshuman71runewolf7runewolf7rohantaneja-vercelrohantaneja-vercelhp_arorahp_arorajoyboy-0joyboy-0matiasperzmatiasperzjverceljverceltannerverceltannervercelgi_wrightygi_wrightymatthewstanciumatthewstanciujnsahajjnsahajrickeymcgregorrickeymcgregorrichardkunklirichardkunklibwalvoordbwalvoordrobpruzanrobpruzandanielroedanielroerahuliyer-vercelrahuliyer-vercelty37zhangty37zhangshawnfeldmanshawnfeldmanjohnphamousjohnphamous6ary6aryricardo-agzricardo-agzaej11aaej11amclenhardmclenhardadriandlamadriandlamreynaldo-vercelreynaldo-verceljaredthompson22jaredthompson22jetthenjetthenrobkebabrobkebabraidaltraidaltcodyellowcodyellowpablostanleypablostanleyronnie-hanifronnie-hanifzypxzypxthecletheclepranavkarthikpranavkarthikandy.rianchoandy.rianchojonasherrjonasherrvanessaxteovanessaxteotomdaletomdalevincent-derksvincent-derksgrappeggiagrappeggiavaguelyseriousvaguelyseriousmkrrmkrrdalyd14dalyd14kaciebkaciebgr2mgr2mkarim_v1karim_v1simhskalsimhskal

Keywords

Readme

@vercel/config

TypeScript SDK for programmatically defining Vercel configuration. Write type-safe routing rules and build configuration in TypeScript instead of JSON.

Installation

npm install @vercel/config

Quick Start

Create a vercel.ts file in your project root:

import { routes, deploymentEnv } from '@vercel/config/v1';
import type { VercelConfig } from '@vercel/config/v1';

export const config: VercelConfig = {
  buildCommand: 'npm run build',
  framework: 'nextjs',

  rewrites: [
    // Simple rewrite
    routes.rewrite('/api/(.*)', 'https://backend.api.example.com/$1'),

    // Rewrite with transforms (no path params)
    routes.rewrite('/(.*)', 'https://api.example.com/$1', {
      requestHeaders: {
        authorization: `Bearer ${deploymentEnv('API_TOKEN')}`,
      },
    }),

    // Type-safe path parameters with callback
    routes.rewrite(
      '/users/:userId/posts/:postId',
      'https://api.example.com/users/$1/posts/$2',
      ({ userId, postId }) => ({
        requestHeaders: {
          'x-user-id': userId,
          'x-post-id': postId,
          authorization: `Bearer ${deploymentEnv('API_KEY')}`,
        },
      })
    ),
  ],

  redirects: [routes.redirect('/old-docs', '/docs', { permanent: true })],

  headers: [
    routes.cacheControl('/static/(.*)', {
      public: true,
      maxAge: '1 week',
      immutable: true,
    }),
  ],

  crons: [{ path: '/api/cleanup', schedule: '0 0 * * *' }],
};

Features

  • Type-safe configuration - Full TypeScript support with IDE autocomplete
  • Type-safe path parameters - Extract :userId from patterns with full IntelliSense
  • Deployment environment variables - Use deploymentEnv() for Vercel project env vars
  • Readable syntax - Helper methods like routes.redirect(), routes.rewrite(), routes.header()
  • Transforms - Modify request/response headers and query parameters on the fly
  • Conditions - Advanced routing with has and missing conditions
  • CLI tools - compile and validate commands for development

Build-Time Compilation

Your vercel.ts is automatically compiled to vercel.json during:

vercel build
vercel dev
vercel deploy

No manual build step needed - the Vercel CLI handles compilation automatically.

CLI Commands

For development and validation:

# Compile vercel.ts to JSON (output to stdout)
npx @vercel/config compile

# Validate config for errors and show summary
npx @vercel/config validate

# Generate vercel.json locally (for development)
npx @vercel/config generate

Important Notes

  • One config file only: You cannot have both vercel.ts and vercel.json.
  • Transforms compile to routes: When you add transforms to rewrites/redirects (like requestHeaders), they're compiled to the lower-level routes primitive internally.
  • Automatic compilation: The Vercel CLI compiles vercel.ts automatically.

Learn More