Catalog npm
Back to packageRELEASE DETAILS

0.61.4

npm

@0xflair/react-ipfs

React components and hooks to work with IPFS. This library uses Flair's APIs to upload and pin the file to IPFS, but the file will not be stored on the backend.

Published21 Jun 2022
Direct dependencies6
Transitive dependenciesNot calculated

README

Current package documentation

Flair SDK: react-ipfs

React components and hooks to work with IPFS. This library uses Flair's APIs to upload and pin the file to IPFS, but the file will not be stored on the backend.

Getting Started

Installation

  1. Install the package:

    npm install @0xflair/react-ipfs
    
  2. Install peer dependencies:

    npm install axios
    
    # if visual components needed:
    npm install tailwindcss @headlessui/react @heroicons/react @tailwindcss/aspect-ratio
    
  3. Configure tailwind.config.js (Tailwind v3) to scan SDK for classes (if visual components needed):

    module.exports = {
      purge: [
        "./public/**/*.html",
        "./src/**/*.{js,jsx,ts,tsx,vue}",
    
        // This line tells Tailwind to look into SDK files
        "./node_modules/@0xflair/**/*.{js,jsx,ts,tsx,vue}",
      ],
      content: ["./src/**/*.{js,jsx,ts,tsx}"],
      plugins: [
        // These plugins are used in this package
        require("@tailwindcss/forms"),
        require("@tailwindcss/aspect-ratio"),
      ],
    };
    

Usage

IPFS Uploader Hook

import { useIpfsFileUploader } from "@0xflair/react-ipfs";

function App() {
  const [userFile, serUserFile] = useState<File>();
  const [{
    data: ipfsUrl,
    error: ipfsError,
    loading: ipfsLoading
  }, ipfsUpload] = useIpfsFileUploader({
    autoUpload: true,
    fromFile: userFile,
  });

  return (
    <ul>
      <li>Choose file: <input type="file" value={userFile} onChange={setUserFile} /></li>
      <li>IPFS Loading: {ipfsLoading ? 'Yes...' : 'Idle'}</li>
      <li>IPFS Error: {ipfsError?.message || ipfsError?.toString()}</li>
    </ul>
  );

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 9

Native requirements
6 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
@0xflair/ipfs
Environment
{
  "local_name": "@0xflair/ipfs",
  "alias": false,
  "peer_metadata": null
}
^0.61.4runtime
@0xflair/react-common
Environment
{
  "local_name": "@0xflair/react-common",
  "alias": false,
  "peer_metadata": null
}
^0.61.4runtime
axios
Environment
{
  "local_name": "axios",
  "alias": false,
  "peer_metadata": null
}
^0.26.1runtime
@types/react
Environment
{
  "local_name": "@types/react",
  "alias": false,
  "peer_metadata": null
}
^18.0.10development
@types/react-dom
Environment
{
  "local_name": "@types/react-dom",
  "alias": false,
  "peer_metadata": null
}
^18.0.5development
@0xflair/ipfs
Environment
{
  "local_name": "@0xflair/ipfs",
  "alias": false,
  "peer_metadata": null
}
0.*peer
@0xflair/react-common
Environment
{
  "local_name": "@0xflair/react-common",
  "alias": false,
  "peer_metadata": null
}
0.*peer
axios
Environment
{
  "local_name": "axios",
  "alias": false,
  "peer_metadata": null
}
^0.26.1peer
react
Environment
{
  "local_name": "react",
  "alias": false,
  "peer_metadata": null
}
^17.0.2||^18.0.0peer

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-ev86bM2NT+YZhLLOIA5a1nsUVsOdxFO/7Sk91jgKkoQVvTBaQF8cyk8De9ruNX1W0aVInjRVfk8VnmrEC5QXcA==",
  "shasum": "35ea5028e75489f1d391580c56726a43cb2c765e",
  "tarball": "https://registry.npmjs.org/@0xflair/react-ipfs/-/react-ipfs-0.61.4.tgz",
  "fileCount": 8,
  "unpackedSize": 117941,
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEUCIACuRpt7CbN49WGJmK85tiMJSAFRCefqnq/V6r0OT19GAiEA2qcFcZ14ymWyb3V1O14UzTXwAj+1jlwlGP3YmGahboM="
    }
  ],
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJisiSKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo3SA//W47S32L9Q2W2MJpbgYq0w+bYzw3EsDzOafILMFrXh152cIUw\r\nM9ZW+l1xEuo1xX1GLVpHVltLpoIpDm4gbl4IQZb5Pn5lqvMdyEziXQ+aNh4K\r\nlUmqIODOXAvgAEhyFVlMuW4/kyHY1NBg4Fzm0dN3rUxDOkYscvfpe42py9g3\r\nM+qHLv3faqU5thMWWGRBLUd3RnmBC+oDK6lSFkFyXJ7Ii6/iGis4c1y/kZXT\r\nHQyam6I9bgqWjlQWKnpCA9zLEZ4mYA2NuAm6fIQx2qc2gXdt0G9QSx692kwj\r\nbkIUo1XtcQ0pbRfHv1Nfk58t9G9AJdm6gTveP3E6v7nvC+zYKL9ZuG3w+RdW\r\n5156FTtK/g1gY5k14QyXvnjZ9AD6Paq2UJoBsu6BFWpdz0enRgVe9BKUFqDI\r\nwFe6wq95vtPfOQ26A3EPDE3rMlRKq1DRXHV0gtzt6Kb35HJg/lGGCUOTpkHr\r\nQINnf4NEHhkG2lOq6mcxXUSnnIIjlHoZZo+qHAWexhF3ABZRpv9GjSQTBLeT\r\nzHby3V5noxzzI+UBUvWhEe1ZjqkgMh9S29qfY9huwXhmWqlxaOdkVdW65S6z\r\nNsqWzX+JuaSUNB7P1iDUIFJps34CaFc/jlEdHGzTe9vir1Ocq8ijLxuerhiL\r\nk6Dpi8CEk0mQCVGYP1kQodgEK5INu1PcbB8=\r\n=X49k\r\n-----END PGP SIGNATURE-----\r\n"
}

Repository

PENDING
0xflair/typescript-sdk

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 23:25 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:2e490bb1ea0694e49c1935b0d3b8e90ca1d13675e4e6ba4dbf64bcd98d332547

Other collected versions

0.123.227 Nov0.123.112 Nov0.123.08 Nov0.122.228 Oct0.122.128 Oct0.122.028 OctView all collected versions →