LeafyGreen Chat Provider
Installation
PNPM
pnpm add @lg-chat/leafygreen-chat-provider
Yarn
yarn add @lg-chat/leafygreen-chat-provider
NPM
npm install @lg-chat/leafygreen-chat-provider
Overview
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 |