Skip to main content

Getting started

Installation & Requirements#

yarn add @pdftron/collab-client

The following are also required:

Integration#

1) Import the module alongside WebViewer

import WebViewer from '@pdftron/webviewer'
import { CollabClient } from '@pdftron/collab-client'

2) After initializing WebViewer, create a new instance of the client

import WebViewer from '@pdftron/webviewer'
import { CollabClient } from '@pdftron/collab-client'
WebViewer({
...wvOptions
}, viewerElement).then(instance => {
const collabClient = new CollabClient({
instance,
url: `http://localhost:3000`,
subscriptionUrl: `ws://localhost:3000/subscribe`
})
})
info

url and subscriptionUrl are the URLs where the server is running. These values are logged by the server when it first starts.

For a full list of constructor options, please see the collab client API reference.

Usage with React#

If you are using React to build your application, we suggest using the React bindings to help you manage your UI's state.

Next steps#