Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • BoundClass
    • CollabClient

Index

Properties

defaultNotificationHandler: (options?: DefaultHandlerParams) => NotificationFunction = defaultNotificationHandler

Type declaration

    • A default function that handles browser notifications. This function asks the user permission to send notifications, and triggers notifications whenever a user receives a new message or invite.

      This function is available as a static on CollabClient

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

      new CollabClient({
      notificationHandler: CollabClient.defaultNotificationHandler({ ...options })
      })

      Parameters

      Returns NotificationFunction

LogTags: typeof LogTags = LogTags
LogLevels: typeof LogLevels = LogLevels
EventManager: EventManager

An instance of EventManager, which you can use to subscribe to certain events

ScrollSyncManager: ScrollSyncManager

An instance of ScrollSyncManager, which you can use to subscribe to manage scroll sync sessions

Constructors

Methods

  • setCustomHeaders(headers: Record<string, string>): void
  • Set the custom headers to be sent with requests to the server. Should not be used unless you are using a custom server.

    Calling this function completely overrides any previously set custom headers.

    Parameters

    • headers: Record<string, string>

    Returns void

  • getUserSession(): Promise<User>
  • Returns the currently signed in user, if it exists

    Returns Promise<User>

  • loginWithToken(token: string): Promise<User>
  • Logs in a user with an authentication token. Returns a user entity if the token is valid. Returns null if token is invalid or any other errors occur

    Parameters

    • token: string

      The token to validate on the server

    Returns Promise<User>

  • loginWithPassword(email: string, password: string): Promise<User>
  • Logs in a user with an email and password Returns a user entity if the password is valid. Returns null if token is invalid or any other errors occur

    Parameters

    • email: string

      The email to send to the server

    • password: string

      The password to send to the server

    Returns Promise<User>

  • loginAnonymously(userName?: string): Promise<User>
  • Logs in a user anonymously. The user's info will be cached and restored if they reload the page and 'loginAnonymously' is called again.

    Parameters

    • userName: string = "Guest"

      The display name to use for the user. Defaults to 'Guest'

    Returns Promise<User>

  • setInstance(instance: WebViewerInstance): void
  • Sets the WebViewer instance. Should only be used if instance is not passed to the constructor

    Parameters

    • instance: WebViewerInstance

      The WebViewer instance

    Returns void

  • setContext(data: Record<any, any>): Promise<Record<any, any>>
  • Sets context about the current user for use on the server. This function overwrites the entire context.

    Parameters

    • data: Record<any, any>

      The custom data to set

    Returns Promise<Record<any, any>>

    Returns the full context set on the server

  • updateContext(data: Record<any, any>): Promise<Record<any, any>>
  • Updates the context about the current user for use on the server. Data passed into this function is merged with any existing data

    Parameters

    • data: Record<any, any>

      The custom data to set

    Returns Promise<Record<any, any>>

    Returns the full context set on the server

  • deleteContext(): void
  • Deletes any custom context set on the server

    Returns void

  • destroy(): Promise<void>
  • Destroys the Collaboration client.

    • Unbinds all events
    • Disconnects websocket connection
    • Logs out the user
    • Destroys all instances of all classes

    Returns Promise<void>

Accessors

  • get currentDocumentId(): string
  • Returns string

Generated using TypeDoc