# Install with NPM

You can also easily integrate Fortmatic into your Javascript dApp written in frameworks such as React. Simply run the script below in your project directory to install the Fortmatic Javascript package from NPM.

Recommended Node and NPM versions: **Node version >= 6.9** and **NPM version >= 3.4**

## Fortmatic Installation Script

```bash
npm install --save fortmatic
```

## Web3 Installation Script

If you are using web3 for your dApp, you can install either the latest stable web3 version or the 1.0 beta version with updated capabilities and syntax. If you are only using the Fortmatic SDK without web3, you may skip this step.

```bash
# Install latest web3 1.0.0-beta.x version
npm install --save web3

# Or install stable web3 0.20.x version
npm install --save web3@0.20
```

## Import into Web3 dApp

Use the following code snippet to import Fortmatic into your web3 dApp.

```javascript
import Fortmatic from 'fortmatic';
// Works for web3 1.0 and pre-1.0 versions
import Web3 from 'web3';

// Pass in the network string value if using test API key
const fm = new Fortmatic('YOUR_API_KEY');
window.web3 = new Web3(fm.getProvider());

// Send transactions the way your are used to
web3.eth.sendTransaction({/* ... */});
```


---

# 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.fortmatic.com/install-with-npm.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.
