react-dmedia-manager
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

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

Prop Description
web3 Web3 instanced used in your dApp. It'll be used to request a signature for authentication.
apiUrl dMedia Manager API URL
projectId Your project ID from dMedia Manager

Readme

Keywords

none

Package Sidebar

Install

npm i react-dmedia-manager

Weekly Downloads

3

Version

0.0.3

License

ISC

Unpacked Size

155 kB

Total Files

60

Last publish

Collaborators

  • strandgeek