# Connect to a Private npm Repository

Typically javascript/typescript based tests will include their dependencies in the `package.json`. If these libraries are hosted in publicly available repositories, Testery will just download them and install them prior to running your tests. But sometimes, you may want to have a privately hosted module (e.g. one that contains wrappers for your business objects).

To connect to a private npm repository, you will want to include the connection info in an `.npmrc` file or simply by adding your npm token as an environment variable.

Click Environments -> Add New Environment (or edit existing).

Under Files click Add File. Call the file `npmrc` and add the following content,

```
//registry.npmjs.org/:_authToken={{INSERT YOUR TOKEN HERE}}
```

The contents of this file will be encrypted on Testery.

When you run tests, the `npmrc` file will be created prior to running `npm install` and give the test runner access to your private npm repository.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.testery.io/how-to/connect-to-a-private-npm-repository.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
