This is a demo middleware designed to demonstrate the capabilities of the unblu middleware library.
It:
-
Automatically creates a bot registration
-
Automatically creates a webhook registration
-
Correctly handles all webhooks and pings (lib handles that)
-
Correctly handles all bot outbound requests and pings (lib handles that)
-
Accepts all visitor onboarding offers
-
Greets a visitor when the dialog is open
-
Echos all visitor messages
-
Logs all messages, not just in a bot dialog (the webhook handler is set up to do so)
Adopt application.yaml
or populate environment variables (e.g. in a .env file):
UNBLU_HOST=https://some-installation.unblu.com
UNBLU_USER=some-unblu-admin-user
UNBLU_PASSWORD=hello-im-some-unblu-admin-user-password
MIDDLEWARE_URL=https://where.my.middleware.is.running
WEBHOOK_SECRET=a-very-secret-key
BOT_SECRET=another-very-secret-key
Run the following command in a terminal window:
./gradlew bootRun
Your middleware application is running on port http://localhost:8080
You might need to configure the configuration templates to include your bot.
Some useful settings:
-
com.unblu.conversation.concierge.conciergeEnabled=false
to disable the concierge -
Enable your external bot with one of:
-
com.unblu.conversation.bot.enableAllExternalBots=true
-
or
com.unblu.conversation.bot.mandatoryExternalBotIds
-
or
com.unblu.conversation.bot.optionalExternalBotIds
-
-
com.unblu.conversation.message.allowChatDuringOnboarding=CONTEXT_PERSON
to give to the visitor the possibility to enter messages during onboarding