react-deck-link
Version:
React SDK for integrating Deck Link
60 lines (45 loc) • 1.15 kB
Markdown
[](https://facebook.github.io/react/) hook and components for integrating
with [Deck Link](https://docs.deck.co/docs/link)
```sh
yarn add react-deck-link
```
```js
import { useDeckLink } from 'react-deck-link';
const OpenLink = () => {
const { open, isError, isReady } = useDeckLink({
token: '<GENERATED_LINK_TOKEN>',
onSuccess: ({ job_guid, public_token }) => {
// send public_token to server
// persist job_guid
},
});
if (isError) {
return <div>Uh oh!</div>;
}
return (
<button onClick={open} disabled={!isReady}>Connect</button>
);
}
```
Please refer to the [official Deck Link docs](https://docs.deck.co/docs/integrating-the-link-sdk)
for a more holistic understanding of Deck Link.
This project is set up using Vite.
```sh
yarn
npx vite
```
To test a local version of this library:
```sh
yarn link
cd ../dashboard
yarn link react-deck-link
```
```sh
npx vite build
yarn publish
```