initConfig()

Used to set up initial configurations for the Velt SDK.

  • Signature: initConfig(apiKey: string, config?: Config)
  • Params: apiKey: string, config?: Config
  • Returns: none

identify()

Used to authenticate the client’s user with the Velt SDK.

  • Signature: identify(user: User, userOptions?: UserOptions)
  • Params: user: User, userOptions?: UserOptions
  • Returns: Promise<unknown>

setDocumentId()

Tell us the unique ID of the current document/resource on which you want to enable collaboration.

  • Signature: setDocumentId(id: string)
  • Params: id: string
  • Returns: none

unsetDocumentId()

You can unset the Document Id to pause the Velt SDK functions.

  • Signature: unsetDocumentId()
  • Params: none
  • Returns: none

setLocation()

Tell us the custom params of the current document/resource to identify sub document inside a document.

  • Signature: setLocation(params: Location, appendLocation?: boolean)
  • Params: params: Location, appendLocation?: boolean
  • Returns: none

removeLocation()

To remove location from a User.

  • Signature: removeLocation(location?: Location)
  • Params: location?: Location
  • Returns: none

setScrollableElementsIds()

Tell us about the scrollable document ids to keep track on its scroll changes.

  • Signature: setScrollableElementsIds(ids: string[])
  • Params: ids: string[]
  • Returns: none

removeScrollableElementsIds()

To remove document params from a User.

  • Signature: removeScrollableElementsIds()
  • Params: none
  • Returns: none

getPresenceElement()

Get the Presence Element Object to access the raw presence data.

  • Signature: getPresenceElement()
  • Params: none
  • Returns: PresenceElement

getCursorElement()

Get the Cursor Element Object to access the raw cursor data.

  • Signature: getCursorElement()
  • Params: none
  • Returns: CursorElement

getCommentElement()

Get the Comment Element Object to access the raw comment data.

  • Signature: getCommentElement()
  • Params: none
  • Returns: CommentElement

getTagElement()

Get the Tag Pin Annotation Object to access the raw tag data.

  • Signature: getTagElement()
  • Params: none
  • Returns: TagElement

getSelectionElement()

Get the Selection Object to enable/disable the feature.

  • Signature: getSelectionElement()
  • Params: none
  • Returns: SelectionElement

getRecorderElement()

Get the Recorder Object.

  • Signature: getRecorderElement()
  • Params: none
  • Returns: RecorderElement

getContactElement()

Get the Contact Object.

  • Signature: getContactElement()
  • Params: none
  • Returns: ContactElement

getRewriterElement()

Get the Rewriter Object.

  • Signature: getRewriterElement()
  • Params: none
  • Returns: RewriterElement

getLiveStateSyncElement()

Get the LiveStateSync Object.

  • Signature: getLiveStateSyncElement()
  • Params: none
  • Returns: LiveStateSyncElement

getArrowElement()

Get the Arrow Object.

  • Signature: getArrowElement()
  • Params: none
  • Returns: ArrowElement

signOutUser()

To sign out a user.

  • Signature: signOutUser()
  • Params: none
  • Returns: any

disableFeatures()

Provide a list of features to disable. Provide an empty array to enable all the features.

  • Signature: disableFeatures(features: Array<FeatureType>)
  • Params: features: Array<FeatureType>
  • Returns: none

addLocation()

Add location to show comments, tags, recorders etc. for provided location also.

  • Signature: addLocation(location: any)
  • Params: location: any
  • Returns: none

isUserAllowed$()

To check if user is allowed in provided document or not.

  • Signature: isUserAllowed$()
  • Params: none
  • Returns: Observable<boolean>

getUserRole$()

To get user role in provided document.

  • Signature: getUserRole$()
  • Params: none
  • Returns: Observable<string | null>

isPlanExpired$()

To check if plan is expired or not.

  • Signature: isPlanExpired$()
  • Params: none
  • Returns: Observable<boolean>

inviteUsers()

To invite a list of users to the document.

  • Signature: inviteUsers(documentUsers: Array<DocumentUser>)
  • Params: documentUsers: Array<DocumentUser>
  • Returns: none

removeVeltContent()

To remove Velt specific content from provided html content.

  • Signature: removeVeltContent(htmlContent: string)
  • Params: htmlContent: string
  • Returns: string

injectCustomCss()

To inject custom CSS.

  • Signature: injectCustomCss(customCss: CustomCss)
  • Params: customCss: CustomCss
  • Returns: none

setLanguage()

To set the language.

  • Signature: setLanguage(language: string)
  • Params: language: string
  • Returns: none

setTranslations()

To set the translations for the language.

  • Signature: setTranslations(language: string, translations: { [key: string]: string })
  • Params: language: string, translations: { [key: string]: string }
  • Returns: none

enableAutoTranslation()

To enable auto translation.

  • Signature: enableAutoTranslation()
  • Params: none
  • Returns: none

disableAutoTranslation()

To disable auto translation.

  • Signature: disableAutoTranslation()
  • Params: none
  • Returns: none

getVeltInitState()

Subscribe to detect whether Velt is initialized.

  • Signature: getVeltInitState()
  • Params: none
  • Returns: Observable<boolean>