The official chat client for Wayble AI
npm install
npm run dev
npm run build
{
"type": "link",
"link": {
"title": "string",
"href": "string"
}
}
{
"type": "image",
"image": {
"src": "string",
"alt": "?string",
"width": "?int",
"height": "?int"
}
}
{
"type": "mapsted",
"mapsted": {
"title": "string",
"url": "string"
}
}
{
"type": "list",
"list": {
"item": "mapsted",
"items": [
{
"type": "mapsted",
"mapsted": {
"title": "string",
"url": "string"
}
}
]
}
}
{
"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": ""
}
}
}
]
}
}
]
}
A short description of the public API interface exposed by the chat client
-
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)
-
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
-
handlePushUpdateHook
- Run when a push update is received