> For the complete documentation index, see [llms.txt](https://docs.notcentralised.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.notcentralised.com/sdk/initialise.md).

# Initialise

In order to begin using **NotVault** within your TypeScript projects, you will need to initialise the library correctly. This initialisation process sets up the necessary connections and providers for the library's operations, particularly for interacting with IPFS and the Ethereum blockchain via JSON-RPC.

#### Environment Variables

Prior to initializing **NotVault**, you'll need to ensure the following environment variables are set:

1. `PUBLIC_URL`
2. `PINATA_API_KEY`
3. `PINATA_SECRET_API_KEY`

These are critical for the functioning of IPFS file operations and the connectivity with Pinata.

#### Initialization Steps

To initialise **NotVault** in a TypeScript environment, follow the steps below:

1. **Import the necessary libraries**:

   ```typescript
   import { NotVault } from '@notcentralised/notvault-sdk';
   import { ethers } from 'ethers';
   ```
2. **Instantiate the NotVault class**:

   ```typescript
   const vault = new NotVault();
   ```
3. **Create an JSON RPC connection**:

   * Set up a new instance of `JsonRpcProvider` from the `ethers` library. You need to pass in your RPC Host URL to the `JsonRpcProvider` constructor.
   * Create a `signer` by creating a new instance of the `Wallet` class from the `ethers` library. Pass in your private key and the custom HttpProvider instance.

   ```typescript
   const customHttpProvider = new ethers.providers.JsonRpcProvider('... RPC Host ...');
   const signer = new ethers.Wallet('... Private Key ...', customHttpProvider);
   ```
4. **Initialise the vault object**: Now, using the `.init` function of the `vault` instance, pass in your Chain ID and the `signer` instance created in the previous step.

   ```typescript
   vault.init('... Chain ID ...', signer);
   ```

After successfully following these steps, your **NotVault** instance is set up and ready for file operations on IPFS and transactions on an EVM compatible blockchain.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.notcentralised.com/sdk/initialise.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
