You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/frontend/fe-components.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,17 @@ sidebar_position: 0.2
6
6
7
7
All ConvoStack components are originally styled in TailwindCSS and exported, so they don't interfere with the styling of your own website. This allows seamless integration with existing components on your site. There are four React components that make up our component library:
8
8
9
+
To ensure ConvoStack frontend components import properly, add the following properties to your tsconfig file:
10
+
11
+
```typescript
12
+
{
13
+
...
14
+
"moduleResolution": "node",
15
+
"esModuleInterop": true
16
+
...
17
+
}
18
+
```
19
+
9
20
## ConvoStackWrapper
10
21
11
22
The `ConvoStackWrapper` component serves as the entry point for integrating our chatbot widget into your site as it provides a shared Redux Toolkit store and React Query Client Provider for all ConvoStack components you choose to add within your application.
To find all the examples below and an already-created repository with the necessary dependencies, simply clone the ConvoStack Quickstart repo and follow the ReadMe to immediately get started.
19
+
20
+
[Clone here!]
21
+
22
+
If instead you want to complete the walkthrough in your own existing Typescript project, follow the steps below:
23
+
16
24
## Installation
17
25
18
26
```bash
19
-
npm install convostack langchain
27
+
npm install convostack langchain@0.0.67 dotenv
28
+
```
29
+
30
+
After installing the following dependencies, create a `.ts` file. For this example, we will create on called `index.ts`
31
+
32
+
Because we are using OpenAI for our AI agents below, create a `.env` file and set:
33
+
34
+
```typescript
35
+
OPENAI_API_KEY=YOUR_API_KEY;
20
36
```
21
37
22
38
## Example 1: OpenAI Agent
23
39
24
40
In this example, we are connecting an OpenAI [LLM](https://js.langchain.com/docs/modules/models/llms/) to the chatbot playground.
0 commit comments