Hyperchat Only


Inbenta created a special build method to allow authorization through the SDK, using Hyperchat credentials: buildWithHCCredentials(configuration)

The configuration parameter is almost the same as in the build method. The difference is that the authorization is now handled internally.

This example shows how to:

  • The configuration needed to use the HTML escalation adapter.
  • The configuration needed for the hyperchat-adapter.
  • How to use the internal adapters.

For more information in each adapter:

html-escalation-adapter configuration

  • The bot shows the escalation form when the user sends a message (The force parameter must be set to true).
  • Questions: This is an array that contains all the questions in the form. Each question is an object that has a label, text, type and validation parameter.
  • Displays "What else can I do for you?" when the user rejects the escalation.
  • Displays a preset message when no-agents are available or when it rejects the escalation.

Hyperchat-adapter configuration

We will be using all the default configuration, and will only set the needed parameters:

  • appId: The ID of the HyperChat app.
  • region: The geographical region where the HyperChat app lives.
  • room: The room where the chat will be open, in this case will depend on the value of q in the url

The following examples use both adapters from the internal code.


<!DOCTYPE html>
        <title>SDK Test</title>
        <meta charset="utf-8">
            window.buildUI = function () {
                var rejectedEscalation = 'What else can I do for you?';
                var noAgentsAvailable = 'There are no agents available just now.';

                // question configuration
                var questions = [
                        label: 'FIRST_NAME',
                        text: 'What\'s your name?',
                        validationErrorMessage: 'Name cannot be empty',
                        validate: function(value) {
                            if (value !== '') {
                                return true;
                            return false;
                        label: 'EMAIL_ADDRESS',
                        text: 'What\s your email?',
                        validationErrorMessage: 'The email format is not correct',
                        validate: function(value) {
                            return /^\s*[\w\-\+_]+(\.[\w\-\+_]+)*\@[\w\-\+_]+\.[\w\-\+_]+(\.[\w\-\+_]+)*\s*$/.test(value);

                    appId: '<chat_app_id>',
                    region: '<chat_app_region>',
                    room: function () {
                        return SDKHCAdapter.helpers.getQueryParameterValue('q');
                    lang: function () {
                        return 'en'; // If the instance has languages configured and 'en' is not one of them, this should be changed to the code of a configured language.

                var configuration = {
                    launcher: {
                        title: "HyperChatbot Demo"
                    adapters: [
                        SDKcreateHtmlEscalationForm(SDKHCAdapter.checkEscalationConditions, questions, rejectedEscalation, noAgentsAvailable, false)

        <script src="https://sdk.inbenta.io/chatbot/1/inbenta-chatbot-sdk.js" onload="buildUI()"></script>

Strict Standards: Only variables should be passed by reference in /var/www/html/src/Controllers/MarkdownController.php on line 73

Strict Standards: Only variables should be passed by reference in /var/www/html/src/Controllers/MarkdownController.php on line 73