Class LivesuppPageAPI

Description

This API allows websites to customize the behaviour of Livesupp through front-end JS on the customer's side.

Hierarchy

  • LivesuppPageAPI

Methods

  • Activates livesigner if there is an activated signature request.

    Returns Promise<void>

  • Returns the current page, this method respects page redirection.

    Returns Promise<PageAPIPage>

  • Returns the current page ID, this method respects page redirection.

    Returns Promise<number>

  • Returns the current page without respecting page redirection.

    Returns Promise<PageAPIPage>

  • Gets the customer's name.

    Returns Promise<string>

  • Returns an array of all operators with their current status.

    Returns Promise<PageAPIOperator[]>

  • Returns the company's pages.

    Returns Promise<PageAPIPage[]>

  • Returns the operator that is currently selected - the selected operator is the one that is displayed on the widget. Returns null if no operator is currently selected - for example when all operators are offline.

    Returns Promise<null | Operator>

  • Replaces the current page by the one described by the provided pageId. See PageAPIPage for more information on how pages in livesupp work and what they mean. It's like replacing a page by a pointer to another page. Example:

    Assume the customer is on a page with id 1.

    switchPage gets called with pageId 3

    From now on, when the customer visits a part of the website that matches to the page with id 1, it gets replaced by the page with id 3.

    However, if the customer's page gets matched to a page with id 2, it does not get replaced. To turn off this behaviour on the visited page, use stopRedirectingPage

    If you want the redirection to stop at a point in time, use the expiration parameter. The default behaviour is that the redirection does not expire.

    Parameters

    • pageId: number
    • Optional options: {
          expiration?: Date;
      }
      • Optional expiration?: Date

    Returns Promise<void>

  • Resets this customer's identity. After this function is called, the old customer's identity is forgotten and a new one is established.

    Returns Promise<void>

  • Selects an operator. The customer can only have one selected operator at any moment. The selection may fail, for example when the operator is not available at the moment. If it fails, the return value is false, otherwise the return value is true.

    Parameters

    • operatorId: number

    Returns Promise<boolean>

  • Sets the customer's name which is then visible to operators.

    Parameters

    • name: string

    Returns Promise<void>

  • Makes an offer to start a conversation to an operator - preferably the selected one.

    Parameters

    • conversationMode: ConversationMode
    • Optional options: {
          pairAnyOperatorOfPage?: boolean;
          placeInQueueIfNotPossible?: boolean;
      }

      pairAnyOperatorOfPage if false, starts a conversation with the selected operator, else with any available operator, default is false
      placeInQueueIfNotPossible if true, in case the operator is not available, it places the customer in a queue, else it fails silently, default is false

      • Optional pairAnyOperatorOfPage?: boolean
      • Optional placeInQueueIfNotPossible?: boolean

    Returns Promise<void>

  • Stops redirection of a page - see redirectCurrentPage for more details.

    Parameters

    • redirectedPageId: number

      id of the page that should not be redirected anymore

    Returns Promise<void>

  • Uses an invitation code.

    Parameters

    • code: string

    Returns Promise<void>

  • TODO: add docs

    Parameters

    Returns Promise<void>

Generated using TypeDoc