@mintgate/mintgate-js
v1.0.2
Published
Token protect any content on any blockchain with the MintGate-JS developer library.
Downloads
13
Keywords
Readme
mintgate-js
Token protect any content on any blockchain with the MintGate-JS developer library.
Getting Started
yarn install @mintgate/mintgate-js
API:
mintgate.embedVideo(linkID, domReference, provider);
Options:
- linkID: the ID of the link (exmaple: LkI0yVFuIW5n in https://mgate.io/go/LkI0yVFuIW5n)
- domReference: container to display the video
- provider (options): Wallet provider to use
React example:
import {useRef, useEffect} from 'react';
import * as mintgate from '@mintgate/mintgate-js';
const linkID = 'LkI0yVFuIW5n'; // postfix of the link https://mgate.io/go/LkI0yVFuIW5n
function App() {
const ref = useRef();
useEffect(()=> {
if(!ref) return;
mintgate.embedVideo(linkID, ref.current)
.then(x=>console.log('done'));
}, [ref]);
return (
<div ref={ref}></div>
);
}
export default App;