---
slug: 30179-import-npm-packages-from-private-registries-in-edge-functions
published: 2024-10-30
change_type: new-feature
affected_products:
  - Edge Functions
page: https://supabase.com/changelog/30179-import-npm-packages-from-private-registries-in-edge-functions
---

# Import NPM packages from private registries in Edge Functions

Edge Functions now support [importing NPM packages](https://supabase.com/docs/guides/functions/dependencies) from private registries. You will need to deploy your functions using Supabase CLI version v1.207.9 or above to make use of this feature.

### How to use packages from private registries

Create a `.npmrc` file within `supabase/functions`. This will allow you to import the private packages into multiple functions. Alternatively, you can place the `.npmrc` file directly inside `supabase/functions/function-name` directory. 

Add your registry details in the `.npmrc` file. Follow [this guide](https://docs.npmjs.com/cli/v10/configuring-npm/npmrc) to learn more about the syntax of npmrc files.
```
@myorg:registry=https://npm.registryhost.com
//npm.registryhost.com/:_authToken=VALID_AUTH_TOKEN
```

After that, you can import the package directly in your function code or add it to the `import_map.json` (https://supabase.com/docs/guides/functions/dependencies).

```typescript
import MyPackage from "npm:@myorg/private-package@v1.0.1"

// use MyPackage
```

To test your function locally, run `supabase functions serve`. When you're ready, you can deploy it to hosted platform by running `supabase functions deploy function-name`
