1.0.0 • Published 6 years ago
excalidraw-share-peer-link v1.0.0
Excalidraw share peer link
Excalidraw share peer link is a lib for React 16+, he provide a simple <a> link and function for generate the href to open new tab of Excalidraw with peer session.
Installation
npm
npm install --save excalidraw-share-peer-linkyarn
yarn add excalidraw-share-peer-linkUsage
Just add the Widget component and generate the link with the generateLink function
import React, { useState, useEffect } from 'react';
import ExcalidrawLink, { generateLink } from 'excalidraw-share-peer-link';
function App() {
const [link, setLink] = useState('');
useEffect(() => {
generateLink().then(result => {
setLink(result);
})
}, [])
return (
<div className="App">
<ExcalidrawLink link={link} label="Go to whiteboard" />
</div>
);
}
export default App;You can bypass the complete link generation and import generateRandomID and generateEncryptionKey and insert those in arguments of generateLink for custom id and key.
1.0.0
6 years ago

