@lg-chat/leafygreen-chat-provider
v6.0.0
Published
lg-chat LeafyGreen Chat Context
Downloads
58,033
Keywords
Readme
LeafyGreen Chat Provider
Installation
PNPM
pnpm add @lg-chat/leafygreen-chat-providerYarn
yarn add @lg-chat/leafygreen-chat-providerNPM
npm install @lg-chat/leafygreen-chat-providerOverview
LeafyGreenChatProvider provides context to LG Chat components, including the assistant name that will be displayed in messages.
Examples
LeafyGreenChatProvider
import { LeafyGreenChatProvider } from '@lg-chat/leafygreen-chat-provider';
function App() {
return (
<LeafyGreenChatProvider assistantName="MongoDB Assistant">
{/* chat components */}
</LeafyGreenChatProvider>
);
}With Custom Assistant Name
import { LeafyGreenChatProvider } from '@lg-chat/leafygreen-chat-provider';
function App() {
return (
<LeafyGreenChatProvider assistantName="MongoDB Assistant">
{/* chat components */}
</LeafyGreenChatProvider>
);
}Properties
| Prop | Type | Description | Default |
| ---------------------------- | ----------- | ----------------------------------------------------------------------------------- | --------------------- |
| assistantName (optional) | string | The name of the AI assistant that will be displayed when AI sends messages to users | 'MongoDB Assistant' |
| children | ReactNode | The chat components to be wrapped by the provider | |
