@hoory/react
TypeScript icon, indicating that this package has built-in type declarations

1.2.4 • Public • Published

hoory-logo
Hoory Inbox on react

Installation

yarn add @hoory/react

This can work on next.js as well, follow the instructions below

Getting started

Simply put this hook in your app layout or main file, and it will load the embedded chat on your website.

Also, you can pass additional options as second parameter to useHoory hook and control the widget.

const api: API = useHoory("WEBSITE_TOKEN", options: Options);

type API = {
  baseUrl: string
  darkMode: DarkMode
  hasLoaded: boolean
  hideMessageBubble: boolean
  isOpen: boolean
  lazyLoad: boolean
  launcherTitle: string
  locale: Locales
  position: BubblePosition
  resetTriggered: boolean
  showPopoutButton: boolean
  type: WidgetType
  useBrowserLanguage: boolean
  forceManualLinkManagement: boolean
  escapeUnreadView: boolean
  autoOpenUnreadConversation: boolean
  websiteToken: string
  widgetStyle: WidgetType
  setUser: (
    userUniqueIdentifier: string,
    userAttributes?: {
      name?: string
      avatar_url?: string
      email?: string
      identifier_hash?: string
      phone_number?: string
      description?: string
      country_code?: string
      city?: string
      company_name?: string
      social_profiles?: {
        twitter?: string
        linkedin?: string
        facebook?: string
        github?: string
      }
    }
  ) => void
  popoutChatWindow: () => void
  removeLabel: (label: string) => void
  reset: () => void
  deleteConversationCustomAttribute: (key: string) => void
  deleteCustomAttribute: (key: string) => void
  toggle: (state?: 'open' | 'open:last-conversation' | 'open:new-conversation' | 'close') => void
  toggleBubbleVisibility: (value: 'show' | 'hide') => void
  setConversationCustomAttributes: (attributes: Record<string, string>) => void
  setCustomAttributes: (attributes: Record<string, string>) => void
  setLabel: (label: string) => void
  setLocale: (locale: Locales) => void
}


type Options = {
  env?: "DEV" | "PROD";
  position?: 'left' | 'right';
  type?: 'standard' | 'expanded_bubble';
  launcherTitle?: string;
  hideMessageBubble: false;
  locale: 'en' | 'es' | 'fr' | 'de' | 'it' | 'pt' | 'ru' | 'zh' | ...
  useBrowserLanguage: boolean;
  darkMode: 'auto' | 'light';
  avatar: string;
  showPopoutButton: boolean;
};

Contributing Guidelines

Read through our Contributing guidelines to learn about our submission process, coding rules and more

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.2.49latest

Version History

VersionDownloads (Last 7 Days)Published
1.2.49
1.2.30
1.2.20
1.2.10
1.2.056
1.1.50
1.1.40
1.0.930
1.0.911
1.0.900
1.0.890
1.0.860
1.0.850
1.0.840
1.0.830
1.0.820

Package Sidebar

Install

npm i @hoory/react

Weekly Downloads

66

Version

1.2.4

License

MIT

Unpacked Size

166 kB

Total Files

29

Last publish

Collaborators

  • hoory-bot
  • jrjs