# Installation

The OCAP Client is a JavaScript library that connects your application to an OCAP blockchain. It works in both Node.js and browser environments. This guide will walk you through installing the client using a package manager.


## Prerequisites

Before you begin, ensure you have the following installed:

* [Node.js](https://nodejs.org/) (which includes the npm package manager)
* [pnpm](https://pnpm.io/) (optional, but recommended)


## Install the Package

You can install the `@ocap/client` package from the npm registry using either `npm` or `pnpm`.

### Using npm

Run the following command in your project's terminal:

```shell npm icon=logos:npm
npm install @ocap/client
```

### Using pnpm

If you prefer using `pnpm`, run this command:

```shell pnpm icon=logos:pnpm
pnpm install @ocap/client
```

This command will download the package and add it to your project's dependencies.


## Verify Installation

After the installation is complete, you can verify that the package is correctly installed by importing it into a JavaScript file. Create a file named `test-client.js` and add the following code:

```javascript Verify Installation icon=logos:javascript
const OCapClient = require('@ocap/client');

if (OCapClient) {
  console.log('Successfully installed and imported @ocap/client!');
} else {
  console.error('Failed to import @ocap/client.');
}
```

Run the file from your terminal:

```shell
node test-client.js
```

You should see the success message printed to the console, confirming that the client is ready to use.


## Next Steps

Now that you have the client installed, you're ready to connect to the blockchain and start making requests. Continue to the next section to learn the basics.

* **[Basic Usage](./getting-started-basic-usage.md)**: Learn how to initialize the client and make your first query.
