0.9.7 • Published 10 months ago

@iblcomponents/ipfs-upload v0.9.7

Weekly downloads
-
License
-
Repository
gitlab
Last release
10 months ago

ipfs-upload

A React Component that enables you to upload a file to IPFS.

NPM downloads JavaScript Style Guide

Install

npm :

npm install @iblcomponents/ipfs-upload

Usage

From the client application you should:

1 . Write the saveOutput callback needed by the component.
2 . Create the configurations object needed by the component. This has to contain Infura related data: you need to create a new key from https://app.infura.io/dashboard/ and get the data from the Project Summary section (PROJECT ID, API Key Secret). The fileUrl and apiUrl values of the configurations object are hardcoded below, you can leave them as they are.
3 . Wrap these in a componentProps object and send it as props to the FileUpload component.
4 . As you upload the file the IPFS url will be returned and handled in the saveOutput callback.

// FileUpload Component : Uploads the selcted File and returns the URL after 
// uploading the file .
import { getAPI } from "@iblcomponents/ipfs-upload";

const App = () =>
{
    const FileUpload = getAPI("FileUpload").getComponent();
    const saveOutput = output => 
    {
        //output contains the uploaded IPFS url, do whatever you need with it 
        // within this function
    };
    
    const configurations = {
        "projectId": "yourInfuraProjectId",
        "projectSecret": "yourInfuraProjectSecret",
        "fileURL": "https://skywalker.infura-ipfs.io/ipfs",
        "apiURL": "https://ipfs.infura.io:5001/api/v0",                                            
    }
    
    const componentProps = {
        saveOutputCallback: saveOutput,
        configurations : configurations        
    }; 
    
    return (<div><FileUpload { ...componentProps }/></div>)
}

export default YourComponent
0.9.7

10 months ago

0.9.6

11 months ago

0.9.5

12 months ago

0.9.0

1 year ago

0.9.2

1 year ago

0.9.1

1 year ago

0.9.4

1 year ago

0.9.3

1 year ago

0.8.9

1 year ago

0.8.8

1 year ago

0.8.5

1 year ago

0.8.4

1 year ago

0.8.7

1 year ago

0.8.6

1 year ago

0.7.9

1 year ago

0.7.8

1 year ago

0.7.7

1 year ago

0.8.1

1 year ago

0.8.0

1 year ago

0.8.3

1 year ago

0.8.2

1 year ago

0.6.7

1 year ago

0.6.6

1 year ago

0.6.9

1 year ago

0.6.8

1 year ago

0.7.2

1 year ago

0.7.1

1 year ago

0.7.4

1 year ago

0.7.3

1 year ago

0.7.0

1 year ago

0.7.6

1 year ago

0.7.5

1 year ago

0.6.3

1 year ago

0.6.5

1 year ago

0.6.4

1 year ago

0.5.8

2 years ago

0.4.9

2 years ago

0.5.7

2 years ago

0.4.8

2 years ago

0.5.9

2 years ago

0.5.4

2 years ago

0.4.5

2 years ago

0.6.2

1 year ago

0.5.3

2 years ago

0.4.4

2 years ago

0.5.6

2 years ago

0.4.7

2 years ago

0.5.5

2 years ago

0.4.6

2 years ago

0.5.0

2 years ago

0.6.1

2 years ago

0.5.2

2 years ago

0.4.3

2 years ago

0.6.0

2 years ago

0.5.1

2 years ago

0.4.2

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.3.8

2 years ago

0.3.7

2 years ago

0.3.6

2 years ago

0.3.5

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.9

2 years ago

0.2.8

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.0.1

2 years ago