Catalog npm
PACKAGE EXPLORERView in registry

@0xflair/react-ipfs

npm

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.

Versions collected438
Direct dependencies6From release 0.123.2
Last observed20 Oct, 23:27 UTC

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.

Versions 438

Collected releases
VersionPublishedDirect dependenciesOpen version
0.120.030 Sept 20226
0.119.229 Sept 20226
0.119.129 Sept 20226
0.119.029 Sept 20226
0.118.329 Sept 20226
0.118.229 Sept 20226
0.118.129 Sept 20226
0.118.029 Sept 20226
0.117.129 Sept 20226
0.117.027 Sept 20226
0.116.522 Sept 20226
0.116.421 Sept 20226
0.116.316 Sept 20226
0.116.215 Sept 20226
0.116.111 Sept 20226
0.116.08 Sept 20226
0.115.37 Sept 20226
0.115.27 Sept 20226
0.115.17 Sept 20226
0.115.07 Sept 20226

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

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:24 UTC

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

Record identity

package:e4e023d9216195a87068e3316894a48c25f6b1221c91b0941765f5c52b454b03