@squiz/chat-ui
TypeScript icon, indicating that this package has built-in type declarations

1.8.1 • Public • Published

ChatUI

Overview

This package provides an out of the box React Chat UI component to integrate with the Squiz DXP Chat AI capability.

Styling

Out of the box this component includes classes, using the BEM class naming method, but does not load styles automatically. An example set of styling is provided in this packages lib directory.

Usage Example

When running in Squiz Matrix or another system where __dxp is routed correctly to the Squiz DXP

import { ChatUI } from '@squiz/chat-ui';

export function Chat = ()=>{
    return <ChatUI ai="CHAT_AI_SQUIZ_DXP_CONSOLE_HERE" greeting="Help can i help?" />
}

When running from a system without automatic routing via the origins /__dxp path a full path to the @squiz/ai-service needs to be provided:

import { ChatUI } from '@squiz/chat-ui';

export function Chat = ()=>{
    return (
        <ChatUI 
            ai="CHAT_AI_SQUIZ_DXP_CONSOLE_HERE"
            aiApiUrl="https://my-domain/__myRoute/to/the/dxp/service/ai" 
            greeting="Help can i help?" 
        />
    )
}

If you have a pre-existing DxpAiService from the @squiz/dxp-ai-client package you can pass this in instead of a aiApiUrl:

import { ChatUI } from '@squiz/chat-ui';
import { DxpAiService } from '@squiz/dxp-ai-client';

export function Chat = ({dxpAiService}: {dxpAiService: DxpAiService<unknown>})=>{
    return (
        <ChatUI 
            ai="CHAT_AI_SQUIZ_DXP_CONSOLE_HERE"
            aiService={dxpAiService} 
            greeting="Help can i help?" 
        />
    )
}

Dependents (0)

Package Sidebar

Install

npm i @squiz/chat-ui

Weekly Downloads

104

Version

1.8.1

License

none

Unpacked Size

695 kB

Total Files

99

Last publish

Collaborators

  • uqureshi
  • ajhawar
  • squiz-dwebster
  • yyang1029
  • samort
  • hlee_squiz_npm
  • aj12
  • asharpe-squiz
  • tbernardes
  • jchaware
  • asittirangsan
  • sholloway
  • rmcavoy-squiz
  • pkiriakou
  • ata-squiz
  • squiz-ksilalahi
  • squiz-lstephan
  • squiz-ncallahan
  • squiz-dschoen
  • azakens
  • azenderowska.squiz
  • pantyporowicz-squiz
  • hnarayanasamy
  • lunowak-squiz
  • mnowakowski1
  • jpolgar-squiz
  • aqureshi-sqz
  • tsmyth
  • djarrott.squiz.net
  • sautade
  • avanschoor-squiz
  • thomasgrob
  • rainger_squiz
  • rszarafinski
  • tadams_squiz
  • pcoshansquiz
  • carlfoster
  • ewyatt
  • bmatters
  • wjarosz
  • jmatthew_squiz
  • bxwu
  • cupreti
  • mdobie
  • cdloh
  • lwright-sq
  • squiz-npm-publish
  • abarnes_squiz
  • gsherwood
  • pnolland
  • chadszinow-squiz
  • deborahsherwood
  • griseborough
  • akarelia
  • sdanis
  • oliverneal
  • lnowak