1.0.3 • Published 1 year ago

resync-widget v1.0.3

Weekly downloads
-
License
Proprietary
Repository
-
Last release
1 year ago

Resync Widget

ResyncWidget is a React component for integrating an AI-powered search widget into your application. It connects seamlessly with your custom API to provide intelligent search capabilities. Built with NextUI and Tailwind CSS for a modern and responsive UI.

Installation

Install the package and its dependencies:

npm install resync-widget @nextui-org/react framer-motion

Tailwind Setup

Add the following configuration to your tailwind.config.js file:

// tailwind.config.js
const { nextui } = require("@nextui-org/react");

module.exports = {
  content: [
    "./src/**/*.{js,ts,jsx,tsx}",
    "./node_modules/@nextui-org/theme/dist/**/*.{js,ts,jsx,tsx}",
  ],
  theme: {
    extend: {},
  },
  darkMode: "class",
  plugins: [nextui()],
};

Usage

Use the ResyncWidget in your application as shown below:

import * as React from "react";
import { NextUIProvider } from "@nextui-org/react";
import ResyncWidget from "resync-widget";

const App = () => {
  return (
    <NextUIProvider>
      <ResyncWidget
        authorization="your-api-key"
        integrationId="your-integration-id"
        organizationDisplayName="Your Organization"
        title="Your Title"
        description="Your Description"
        primaryBrandColor="#123456"
      />
    </NextUIProvider>
  );
};

export default App;

Properties

All properties are optional.

PropertyTypeDescription
authorizationstringRequired. API authorization token to authenticate requests.
integrationIdstringRequired. ID of the integration to be used.
guidancestringOptional. Guidance for the chat session.
contextstringOptional. Context information for the chat session.
rolestringRole of the user. Default value is "user".
tagsstring[]Optional. Tags to associate with the chat session.
chatModestringMode of the chat. Default value is "AUTO".
streambooleanDetermines whether streaming is enabled. Default value is true.
organizationDisplayNamestringDisplay name of the organization.
titlestringTitle for the widget.
descriptionstringDescription for the widget.
primaryBrandColorstringPrimary brand color for the widget styling.
botAvatarLightReact.ReactNodeOptional. Light mode avatar for the bot.
botAvatarDarkReact.ReactNodeOptional. Dark mode avatar for the bot.
questionsstring[]Optional. Default questions to show in the widget. Default value is ["What are embeddings?"]
searchButtonType"searchbar" | "icon" | "iconSearch"Type of the search button. Default value is "searchbar".
customButtonReact.ReactNodeOptional. Custom button element to trigger the widget.
classNamesobjectOptional. Custom class names for different parts of the widget.
classNames.buttonstringOptional. Custom class name for the button.
classNames.modalstringOptional. Custom class name for the modal.
classNames.modalHeaderstringOptional. Custom class name for the modal header.
classNames.cardstringOptional. Custom class name for the card.
classNames.cardHeaderstringOptional. Custom class name for the card header.
classNames.cardBodystringOptional. Custom class name for the card body.
classNames.modalFooterstringOptional. Custom class name for the modal footer.
classNames.searchButtonstringOptional. Custom class name for the search button.
classNames.closeButtonstringOptional. Custom class name for the close button.
classNames.submitButtonstringOptional. Custom class name for the submit button.