JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q74561F
  • License UNLICENSED

Package Exports

  • @open-chat/search-widget
  • @open-chat/search-widget/dist/style.css

Readme

@openchat/search-widget

search widget now becomes pacakge.

Pros

  • Can be installed in any react application without the need to be embedded inside html itself.

  • Can be used inside our dashboard's workshop for easy customization.

Cons

  • more boilerplate code needed.

  • more build configurations.

How to use it

1- the embeded version (initilizeChatBot)

export type ColorsType = {
  dark: {
    primary: string;
    accent: string;
    background: string;
    foreground: string;
    backgroundLight: string;
  };
  light: {
    primary: string;
    accent: string;
    background: string;
    foreground: string;
    backgroundLight: string;
  };
};

type OptionsType = {
    colors?: ColorsType | undefined;
    mode?: ModeType | undefined;
    initialFirstMessage?: string | undefined;
    token: string;
}
const options:OptionsType = {
    colors: // optional defaults to the current colors if not provided
    mode: 'light'| "dark" // doesn't do any thing for now
}

initilizeChatBot(options) // call it after the document loaded.