BotStacksChatProvider
The provider creates a chat context and is the cornerstone for interacting with BotStacks data.
Component
The BotStacksChatProvider
component must wrap all chat related components. It is used to setup the store and API.
Theming
The UI Kit allows you to define both a light and a dark theme. You can pass both to the themes prop and utilize the
darkMode
prop to toggle which theme is used. If you do not pass any themes to the theme prop, the
default themes will be used.
Default Themes
The default themes are defined below:
Dark mode
If you wish to use only the dark theme, you can define it as such:
useChat
Any component wrapped by the BotStacksChatProvider
component has access to the store. To create a reference
in your component, you can use the useChat
function. For more details on the store and how to use it, check out
the SDK documentation.
Import
Usage
API
Import
Props
Name | Type | Default | Description |
---|---|---|---|
children | node | The content of the app | |
apiKey | string | The API Key for the chat project | |
darkMode | boolean | false | Set to true to enable dark mode |
assets | Assets | {} | The object containing various assets to be used. Only applicable when
using the |
themes | Themes | Default themes | The object containing various assets to be used. Only applicable when
using the |
Was this page helpful?