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 IDLP_USER
- Your LivePerson agent usernameLP_PASS
- Your LivePerson agent password
-
Run:
LP_ACCOUNT=1234567 LP_USER=BotUserName LP_PASSWORD=b0tpa55word node examples/greeting-bot/greeting-bot.js
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.
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 IDLP_USER
- Your LivePerson agent usernameLP_PASS
- Your LivePerson agent password
-
Run:
LP_ACCOUNT=1234567 LP_USER=BotUserName LP_PASSWORD=b0tpa55word node examples/agent-bot/main.js
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.