1.0.93 • Published 26 days ago

@hoory/react v1.0.93

Weekly downloads
-
License
MIT
Repository
-
Last release
26 days ago

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: "auto" | "light";
  hasLoaded: boolean;
  hideMessageBubble: boolean;
  launcherTitle: string;
  locale: 'en' | 'es' | 'fr' | 'de' | 'it' | 'pt' | 'ru' | 'zh' | ...
  position: "left" | "right";
  resetTriggered: boolean;
  showPopoutButton: boolean;
  type: "standard" | "expanded_bubble";
  useBrowserLanguage: boolean;
  websiteToken: string;
  widgetStyle: "standard" | "expanded_bubble";
  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: (open?: boolean) => void;
  toggleBubbleVisibility: (visible?: boolean) => 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

1.0.93

26 days ago

1.0.91

2 months ago

1.0.90

5 months ago

1.0.89

5 months ago

1.0.86

8 months ago

1.0.85

8 months ago

1.0.84

8 months ago

1.0.83

8 months ago

1.0.82

8 months ago