> For the complete documentation index, see [llms.txt](https://theblockchainchief.gitbook.io/web3stash/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://theblockchainchief.gitbook.io/web3stash/services/ipfs-http-client.md).

# IPFS HTTP CLIENT

Dive into the specifics of connecting and using IPFS HTTP CLIENT with web3stash

## Initialization

To use IPFS HTTP Client which actually allows you to connect to local or your own hosted ipfs providers you have to pass "IPFS-CLIENT" as the service name. No other name will work!

```javascript
const ipfsClientService = Web3Stash("IPFS-CLIENT",{url:{}},{IPFS-Http-Client APIconfig options})
```

## Configuration&#x20;

To use IPFS Http Client in web3stash, you need one thing:

* url- URL to connect to ipfs node

There are multiple ways of passing url-

```
// connect to ipfs daemon API server
const url = 'http://localhost:5001'

// or connect with multiaddr
const url = '/ip4/127.0.0.1/tcp/5001'

// or using options
const url = { host: 'localhost', port: '5001', protocol: 'http', headers:{} }

// or specifying a specific API path
const url = { host: '1.1.1.1', port: '80', apiPath: '/ipfs/api/v0' }


const ipfsClientService = Web3Stash("IPFS-CLIENT",{url:url})

```

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

#### Optional Config Options

There are no configOptions for this service

## Methods Available

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

* Uploading JSON data&#x20;

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

* Uploading Image

```javascript
ipfsClientService.uploadImage("./image.png", {ipfsClientOptions}).then().catch()
```

* Uploading Video

```javascript
ipfsClientService.uploadVideo("./video.mp4", {ipfsClientOptions}).then().catch()
```

* Uploading File

<pre class="language-javascript"><code class="lang-javascript"><strong>ipfsClientService.uploadFile("./data.txt", {ipfsClientOptions}).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
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:

```
GET https://theblockchainchief.gitbook.io/web3stash/services/ipfs-http-client.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.
