# NFT.STORAGE

Dive into the specifics of connecting and using NFT.STORAGE with web3stash

## Initialization

To use NFT.STORAGE you have to pass "NFT.STORAGE" as the service name. No other name will work!

```javascript
const nftstorageService = Web3Stash("NFT.STORAGE",{token:""},{nftstorage APIconfig options})
```

## Configuration&#x20;

To use nftstorage in web3stash, you need one thing:

* token - API token generated from nftstorage dashboard

Note: Use these names only while passing keys in object i.e, {token:"",}

#### Optional Config Options

You can pass config options that is available with nftstorage service- You can check nftstorage docs to check what config options are there which you can pass while initialising nftstorage

## Methods Available

The following methods are available for this service, More will be added soon

* Uploading JSON data&#x20;

```javascript
nftstorageService.uploadJson({name:"example", url:"abc.com"}, {nftstorageOptions}).then().catch()
```

* Uploading Image

```javascript
nftstorageService.uploadImage("./image.png", {nftstorageOptions}).then().catch()
```

* Uploading Video

```javascript
nftstorageService.uploadVideo("./video.mp4", {nftstorageOptions}).then().catch()
```

* Uploading File

<pre class="language-javascript"><code class="lang-javascript"><strong>nftstorageService.uploadFile("./data.txt", {nftstorageOptions}).then().catch()
</strong></code></pre>

## Output

All the functions return id (cid) and metadata (data returned by the service on upload)

<pre class="language-javascript"><code class="lang-javascript"><strong>{id:"dewfnlpweurmwknrwiojhgcbxczz", metadata:{}}
</strong></code></pre>


---

# 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://theblockchainchief.gitbook.io/web3stash/services/nft.storage.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.
