Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@ombori/grid-conversation-assistant

Package Overview
Dependencies
Maintainers
0
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ombori/grid-conversation-assistant

Assist end-users with guided conversation using a coversation tree in a simple chatbox

latest
npmnpm
Version
4.1.34
Version published
Maintainers
0
Created
Source

Grid Conversation Assistant

Assist end-users with guided conversation using a coversation tree in a simple chatbox

Installation

npm i @ombori/grid-conversation-assistant

or

yarn add @ombori/grid-conversation-assistant

Basic Usage

  • Wrap your component with the provider
import { StateMachineProvider } from '@ombori/grid-conversation-assistant';

...

return (
  <StateMachineProvider>
    <App />
  </StateMachineProvider>
);
  • Load the chat box anywhere you like
import { ChatBoxAssistant } from '@ombori/grid-conversation-assistant';

...

const url = 'https://media.omborigrid.com/media/5fa9185661e2a7e910f2e55b/sample-conversation-tree.json';

return (
  <ChatBoxAssistant conversationTreeUrl={url} />
);

Sample Conversation Tree File

Advanced Usage

  • Override styling
import { ChatBoxAssistant, ChatBoxHeader, StateMachineCurrentState } from '@ombori/grid-conversation-assistant';
import styled from '@emotion/styled';

const ChatBoxAssistantStyled = styled(ChatBoxAssistant)`
  width: 500px;
  
  .chat-bubble-option,
  .btn-close {
    border-radius: ${({ theme }) => getBorderRadius(theme.buttonsBorderType)};
    background-color: ${({ theme }) => theme.colors.primary};
  }
  .chat-question {
    border-radius: 0;
    box-shadow: unset;
    background-color: unset;
    padding: 0;
    border: 0;
  }
  .chat-response {
    border-radius: ${({ theme }) => getBorderRadius(theme.buttonsBorderType)};
    margin-bottom: 45px;
  }
  .btn-reset {
    border-radius: ${({ theme }) => getBorderRadius(theme.buttonsBorderType)};
  }
`;
  • Change default header, labels
  • Capture user interaction and decide how to handle them in your app
...

const url = 'https://media.omborigrid.com/media/5fa9185661e2a7e910f2e55b/sample-conversation-tree.json';

return (
  <ChatBoxAssistantStyled
    conversationTreeUrl={url}
    header={
      <ChatBoxHeader
        title="My Product Guide"
        subtext="Choose an option that fits your needs"
      />
    }
    resetButtonText="Start Again"
    closeButtonText="Close Guide"
    onChange={(current: StateMachineCurrentState) => {
      // This is where you decide what to do with user interaction
      // e.g. when user selects options in the assisted conversation
    }}
  />
);

FAQs

Package last updated on 26 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts