@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.