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.


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.

Next steps#