Skip to main content

Getting started

Installation & Requirements#

yarn add @pdftron/collab-client

The following are also required:


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'
}, viewerElement).then(instance => {
const collabClient = new CollabClient({
url: `http://localhost:3000`,
subscriptionUrl: `ws://localhost:3000/subscribe`

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#