Skip to content

Latest commit

 

History

History
 
 

examples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Running The Sample Apps

Greeting Bot

The greeting bot is a very simple implementation of the SDK in which the bot joins every conversation as a manager and sends the line "welcome from bot".

Pre-requisites:

  • A LivePerson Account with Messaging
  • A user with Agent Manager permissions

To run the greeting bot example:

  • Provide the following env variables:

    • LP_ACCOUNT - Your LivePerson account ID
    • LP_USER - Your LivePerson agent username
    • LP_PASS - Your LivePerson agent password
  • Run:

    LP_ACCOUNT=1234567 LP_USER=BotUserName LP_PASSWORD=b0tpa55word node examples/greeting-bot/greeting-bot.js

Agent Bot

The agent bot is an example SDK implementation in which the bot accepts incoming conversations as the assigned agent. It listens for messages from the consumer and upon receipt marks them as read and echos them back to the consumer. This example extends the Agent class, which you can read more about below.

See example explanation

Pre-requisites:

  • A LivePerson Account with Messaging
  • A user with Agent permissions

To run the agent bot example

  • Provide the following env variables:

    • LP_ACCOUNT - Your LivePerson account ID
    • LP_USER - Your LivePerson agent username
    • LP_PASS - Your LivePerson agent password
  • Run:

    LP_ACCOUNT=1234567 LP_USER=BotUserName LP_PASSWORD=b0tpa55word node examples/agent-bot/main.js

Bot Cluster

See example documentation

Extending the Agent Class

The best way to use the SDK is to extend the Agent class with your own logic and then instantiate this object in your projects, as demonstrated in a very basic way in the agent bot example.

For more extensive bot examples, all of which extend the Agent class, check out the extended messaging bot samples repository.