Skip to main content

Getting started

The following is documentation for @pdftron/collab-react - React bindings for the Collaboration Client!

This package contains a set of hooks which can be used to maintain state inside of a React application.

Installation & requirements#

yarn add @pdftron/collab-react

The following are also required:

Integration#

Import CollabClientProvider and render it at the root of your application. You must pass your instance of CollabClient to it as well:

import { CollabClientProvider } from '@pdftron/collab-react';
import { CollabClient } from '@pdftron/collab-client';
import App from './App';
const client = new CollabClient({
url: 'http://localhost:3000/',
subscriptionUrl: 'ws://localhost:3000/subscribe',
})
export function Root() {
return (
<CollabClientProvider client={client}>
<App>
</CollabClientProvider>
)
}

After this step, you now have access to all the exported hooks.