Use a custom NPM registry for Edge Function dependencies

Jan 7, 2025

Some organizations require using all modules from a private NPM registry for security and compliance reasons. Edge Functions now supports configuring a private registry to load all NPM modules using the NPM_CONFIG_REGISTRY environment variable.

You can define a private registry in the project's .env file or directly specify it when running the deploy command:


_10
NPM_CONFIG_REGISTRY=https://custom-registry/ supabase functions deploy my-function

You will need Supabase CLI version 2.2.8 or higher to use this feature.

Note that Edge Functions also supports importing private NPM packages (which can be published on any registry).

Check the Managing dependencies guide to learn more about how to configure and use external dependencies in your Edge Functions.

Build in a weekend, scale to millions