Updated by Paulo Bernardo
- After creating a web channel following this documentation, it is necessary to have the uuid of the channel to integrate with Pushinho v2
inputTextFieldHint: 'Type a message...',
<div id="webchat"/>is mandatory, and this
idis used by Pushinho in the
selector. attribute. Make sure they are the same, otherwise Pushinho will not work.
initPayloadattribute is the text that will be sent to Push's
channelUuidwhen Pushinho is initialized. The text in
initPayloadcan be used as a trigger to start a flow in Push, and with that, send a welcome message to the user.
- At the end of the script the
WebChat.open()method is called, it is responsible for expanding the chat
- Pushinho uses Markdown to show messages, make sure the Markdown syntax is correct, otherwise the text will be formatted incorrectly.
- Some parameters, if not specified, have a default value defined by Pushinho, having as main:
- More parameters can be found here.
Dealing with chat history
- Pushinho has 2 strategies for saving the chat history, they are
session. By default, Pushinho uses
local: The local history persists after the browser is closed, and can be cleared when the browser cookies are deleted, or when
session: The session history persists when the page is reloaded, but is deleted when the browser, or tab, is closed. The session history can also be deleted when
- To use
sessionmode, add this attribute:
Showing the tooltip
- To show the user a tooltip, simply add the
tooltipMessageattribute with the desired message.
tooltipMessage: "tooltip message",
A delay can be applied to show the tooltip, the
tooltipDelayattribute is responsible for this, and comes with a default value of 500ms.
tooltipDelay: 30000, // Delay count at milliseconds
- Pushinho can be customized in 2 ways:
- Using a
.cssfile to apply any desired styles based on the classes that Pushinho has.
- Using customization attributes at app launch. The full list of attributes can be found here.
To use the customization attributes, just add the parameter
customizeWidgetin the script, and within it, use the customization attributes
Pushinho's Profile Image
- Three attributes are responsible for the profile image
profileAvatar: Responsible for the image that will appear in the header next to the Title, and within the chat along with the messages sent by the bot.
openLauncherImage: Responsible for the image that will be shown in the Pushinho launcher, while the chat is closed.
closeImage: Responsible for the image that will be shown in the Pushinho launcher, while the chat is open.
- Some methods are available and can be used to interact with Pushinho, some of them are:
WebChat.toggle(): Used to open and close the chat.
WebChat.open(): Used to open the chat.
WebChat.close(): Used to close the chat.
- The list of all methods can be found here.