wayble-chat

1.3.5 • Public • Published

Wayble Chat UI

The official chat client for Wayble AI

Setup & Run

npm install

npm run dev

npm run build

Chat Media Types

Link

{
  "type": "link",
  "link": {
    "title": "string",
    "href": "string"
  }
}

Image

{
  "type": "image",
  "image": {
    "src": "string",
    "alt": "?string",
    "width": "?int",
    "height": "?int"
  }
}

Mapsted

{
  "type": "mapsted",
  "mapsted": {
    "title": "string",
    "url": "string"
  }
}

List

{
  "type": "list",
  "list": {
    "item": "mapsted",
    "items": [
      {
        "type": "mapsted",
        "mapsted": {
          "title": "string",
          "url": "string"
        }
      }
    ]
  }
}

Media Type Example

{
  "media": [
    {
      "type": "list",
      "list": {
        "item": "mapsted",
        "items": [
          {
            "type": "mapsted",
            "mapsted": {
              "title": "Coffee Shop East 21",
              "url": "https://domain.com/wayfinding?building=1&floor=2&entity=4"
            }
          },
          {
            "type": "mapsted",
            "mapsted": {
              "title": "Coffee Shop West",
              "url": "https://domain.com/wayfinding?building=1&floor=3&entity=5"
            }
          }
        ]
      }
    },
    {
      "type": "list",
      "list": {
        "item": "product",
        "items": [
          {
            "type": "product",
            "product": {
              "title": "",
              "image": {
                "src": "/static/products/hat.jpeg",
                "alt": "My fancy hat",
                "width": "",
                "height": ""
              }
            }
          }
        ]
      }
    }
  ]
}

API Interface

A short description of the public API interface exposed by the chat client

Actions

  • POST: getChat() - Fetches the chat object and its messages
  • POST: createChat() - Creates a chat and returns the chat object and its messages
  • POST: sendChatMessage() - Sends a message to the chatbot/chat and return the chat message (reply)

Events

  • onChatLoaded() - Fired when the chat is loaded
  • onChatMessageSent() - Fired when a message is sent to the chatbot/chat
  • onChatMessageReceived() - Fired when a message is received from the chatbot/chat

Hooks

  • handlePushUpdateHook - Run when a push update is received

Readme

Keywords

Package Sidebar

Install

npm i wayble-chat

Weekly Downloads

1

Version

1.3.5

License

none

Unpacked Size

373 kB

Total Files

4

Last publish

Collaborators

  • selvinatmod