Skip to content

unblu/example-middleware

Repository files navigation

Test middleware

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)

Get it running

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 Application

Run the following command in a terminal window:

./gradlew bootRun

Your middleware application is running on port http://localhost:8080

Useful conversation configurations

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

About

This is a demo middleware designed to demonstrate the capabilities of the unblu middleware library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages