Hoory `react/next.js` integration!
const API = useHoory('TOKEN', { manualLoad: true });
Install it:
$yarn add @hoory/react
Use it:Full documentation can be found about how to use SDK here
import React from 'react';
import { useHoory } from '@hoory/react';
export default function App() {
const API = useHoory('WEBSITE_TOKEN');
return (
<div className="App">
<button onClick={() => API.toggle() }>Toggle</button>
</div>
);
}
Properties
Property on API | Description | Value |
---|---|---|
hasLoaded | Shows if widget is loaded or not | false |
baseUrl | Base URL of the widget | |
websiteToken | Website token | |
hideMessageBubble | Hide message bubble | false |
position | Position of the widget | right |
useBrowserLanguage | Use browser language | false |
type | Type of the widget | standard |
launcherTitle | Launcher title | |
showPopoutButton | Show popout button | false |
widgetStyle | Widget style | standard |
darkMode | Dark mode | auto |
resetTriggered | Reset triggered | false |
Methods
Methods on API | Description | Test |
---|---|---|
setUser | Set user data | |
popoutChatWindow | Popout chat window | |
removeLabel | Remove label from user | |
reset | Reset widget | |
deleteConversationCustomAttribute | Delete conversation custom attribute | |
deleteCustomAttribute | Delete custom attribute | |
toggle | Toggle widget | |
toggleBubbleVisibility | Toggle bubble visibility | |
setConversationCustomAttributes | Set conversation custom attributes on conversation | |
setCustomAttributes | Set custom attributes on user | |
setLabel | Set label to user | |
setLocale | Set locale | |
sdk.reRun | Re-Run the widget |