# INFURA

Dive into the specifics of connecting and using INFURA with web3stash

## Initialization

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

```javascript
const infuraService = Web3Stash("INFURA",{projectId:"", projectSecret:""},{Infura APIconfig options})
```

## Configuration&#x20;

To use INFURA in web3stash, you need two things:

* projectId - Project Id from infura dashboard
* projectSecret - Project Secret from infura dashboard



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

#### 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
infuraService.uploadJson({name:"example", url:"abc.com"}, {infuraServiceOptions}).then().catch()
```

* Uploading Image

```javascript
infuraService.uploadImage("./image.png", {infuraServiceOptions}).then().catch()
```

* Uploading Video

```javascript
infuraService.uploadVideo("./video.mp4", {infuraServiceOptions}).then().catch()
```

* Uploading File

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