0.0.3 • Published 2 years ago

react-dmedia-manager v0.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

React dMedia Manager

This is the react library for integrating dMedia Manager into a dApp.

Usage

See below the minimal example to integrate the dMedia Manager Picker into your dApp:

import { MediaPicker, useMediaPicker } from "react-dmedia-manager";


export const MyPickerMediaComp = ({ web3 }) => {
  const { mediaPicker } = useMediaPicker({
    web3,
    apiUrl: 'https://dmedia-manager.strandgeek.com/api/v1',
    projectId: 'YOUR PROJECT ID',
  });
  return (
    <div>
      <button
        type="button"
        onClick={() => mediaPicker.open()}
      >
        Select Media...
      </button>
      <MediaPicker mediaPicker={mediaPicker} />
      <div>
        Selected Media: {mediaPicker.ipfsCID}
      </div>
    </div>
  )
}

MediaPicker component

PropDescription
web3Web3 instanced used in your dApp. It'll be used to request a signature for authentication.
apiUrldMedia Manager API URL
projectIdYour project ID from dMedia Manager