1.3.0 • Published 6 months ago

@foxitsoftware/web-collab-client v1.3.0

Weekly downloads
-
License
Commercial
Repository
-
Last release
6 months ago

Web Collaboration Client

Welcome to the API documentation for the web collaboration client, which is a client component of Foxit Web Collaboration Add-on.

Installation

Web Collaboration Client runs in a web browser and is available as a NPM package.

npm install @foxitsoftware/web-collab-client

Usage

import { WebCollabClient } from "@foxitsoftware/web-collab-client"

const client = new WebCollabClient({
  baseURL: "http://localhost:8080",
  pdfViewer: pdfViewerInstance,
  userProvider: () => {
    // The user information is up to the app level to provide and will be applied in the collaboration client module.
    return {
      id: 'some-user-id-from-user-app',
      username: "some-user",
      token: "user-token" // The token is used for authentication, token validation should be implemented on server side
    }
  }
})

// create a collaboration for a pdf doc
const collaboration = client.createCollaboration({
  fileUrl: 'http://path-to-your-pdf-file.pdf',
  isDocPublic: true,
  docName:'path-to-your-pdf-file.pdf'
})

// begin collaboration session
collaboration.begin()