Learn how to configure the npm client to use DepAegis as your private package registry, including authentication, scoped packages, and upstream proxying.
The .npmrc file controls how npm interacts with registries. You can configure DepAegis at three levels:
| Level | File Location | Scope |
|---|---|---|
| Per-project | /path/to/project/.npmrc | Only the current project |
| Per-user | ~/.npmrc | All projects for the current user |
| Global | $PREFIX/etc/npmrc | All users on the system |
The simplest configuration points npm to your DepAegis registry:
registry=https://app.depaegis.com/api/v1/npm/
//app.depaegis.com/:_authToken=${DEPAEGIS_TOKEN}.npmrc (with a variable reference, not a real token) ensures every developer and CI pipeline uses the correct registry automatically.DepAegis uses Bearer token authentication. Generate an access token from the DepAegis dashboard under Settings → Access Tokens, then configure it in your .npmrc:
//app.depaegis.com/:_authToken=${DEPAEGIS_TOKEN}Then set the environment variable in your shell or CI configuration:
export DEPAEGIS_TOKEN="dap_abc123def456..."//app.depaegis.com/:_authToken=dap_abc123def456....npmrc files and add .npmrc with hardcoded tokens to your .gitignore.DepAegis does not support interactive npm login (adduser). Authentication is token-based: create an access token in the dashboard and reference it in your .npmrc as shown above. npm sends it automatically on every request to app.depaegis.com.
If you want to use DepAegis only for specific scopes (e.g. @myorg) while keeping the default registry pointing to the public npm registry:
# Default: public npm registry
registry=https://registry.npmjs.org/
# @myorg scope goes to DepAegis
@myorg:registry=https://app.depaegis.com/api/v1/npm/
//app.depaegis.com/:_authToken=${DEPAEGIS_TOKEN}With this configuration, npm install @myorg/ui-components pulls from DepAegis, while npm install lodash pulls from the public registry.
To ensure a package is always published to DepAegis regardless of the user's default registry, add publishConfig to your package.json:
{
"name": "@myorg/design-tokens",
"version": "1.2.0",
"publishConfig": {
"registry": "https://app.depaegis.com/api/v1/npm/"
}
}This overrides the registry setting only for npm publish, so developers can keep their default registry pointing elsewhere.
Check your active npm configuration at any time:
npm config listFor a more detailed view including all sources:
npm config list --longVerify the registry is set correctly:
npm config get registry
# Should output: https://app.depaegis.com/api/v1/npm/Then confirm auth works by listing a package from your feed (any package name — a 404 for an unknown package means the token was accepted):
npm view @myorg/your-package --registry=https://app.depaegis.com/api/v1/npm/DepAegis can act as a proxy (upstream cache) for the public npm registry. When enabled, requests for packages not found in DepAegis are forwarded to the upstream registry, and the response is cached locally.
npm install react.react exists in the private registry.react are served from cache.When DepAegis is configured as an upstream proxy, set your default registry to DepAegis for all packages:
registry=https://app.depaegis.com/api/v1/npm/
//app.depaegis.com/:_authToken=${DEPAEGIS_TOKEN}
# Optional: bypass cache for specific packages
# @public:registry=https://registry.npmjs.org/.npmrc. Ask your organization administrator, or contact support, to enable upstream proxying for your feeds.A production-ready per-project .npmrc for a team using DepAegis as both a private registry and an upstream proxy:
# DepAegis registry (acts as upstream proxy for public packages too)
registry=https://app.depaegis.com/api/v1/npm/
# Authentication
//app.depaegis.com/:_authToken=${DEPAEGIS_TOKEN}
# Strict SSL (default: true, set to false only for self-signed certs)
//app.depaegis.com/:strict-ssl=true
# Verify package integrity
//app.depaegis.com/:always-auth=true