Skip to main content

Getting started

Installation & Requirements#

yarn add @pdftron/collab-client

WebViewer and a running instance of @pdftron/collab-server is also a requirement.

You will also need a file storage provider such as Amazon S3 to store files.

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.

Next steps#