Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/davidbonan/excalidraw-share-peer-link
Link to excalidraw from tiers application React
https://github.com/davidbonan/excalidraw-share-peer-link
Last synced: 4 months ago
JSON representation
Link to excalidraw from tiers application React
- Host: GitHub
- URL: https://github.com/davidbonan/excalidraw-share-peer-link
- Owner: davidbonan
- Created: 2020-03-31T00:21:21.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-12-12T08:36:10.000Z (about 2 years ago)
- Last Synced: 2023-09-20T08:33:02.129Z (about 1 year ago)
- Language: JavaScript
- Size: 3.89 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# Excalidraw share peer link
[![npm package][npm-badge]][npm]
[![Coveralls][coveralls-badge]][coveralls][npm-badge]: https://img.shields.io/npm/v/npm-package.png?style=flat-square
[npm]: https://www.npmjs.org/package/excalidraw-share-peer-link[coveralls-badge]: https://img.shields.io/coveralls/user/repo/master.png?style=flat-square
[coveralls]: https://coveralls.io/github/davidbonan/excalidraw-share-peer-linkExcalidraw share peer link is a lib for React 16+, he provide a simple `` link and function for generate the href to open new tab of Excalidraw with peer session.
## Installation
#### npm
```bash
npm install --save excalidraw-share-peer-link
```#### yarn
```bash
yarn add excalidraw-share-peer-link
```## Usage
Just add the Widget component and generate the link with the generateLink function
```js
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 (
);
}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.