updated deployment and create react widget guide

This commit is contained in:
Alex
2023-09-15 11:00:59 +01:00
parent 2a83318739
commit 26f7a9be0a
4 changed files with 80 additions and 17 deletions

View File

@@ -2,5 +2,9 @@
"Chatwoot-extension": {
"title": "💬️ Chatwoot Extension",
"href": "/Extensions/Chatwoot-extension"
}
},
"react-widget": {
"title": "🏗️ Widget setup",
"href": "/Extensions/react-widget"
},
}

View File

@@ -0,0 +1,37 @@
### How to set up react docsGPT widget on your website:
### Installation
Got to your project and install a new dependency: `npm install docsgpt`
### Usage
Go to your project and in the file where you want to use the widget import it:
```js
import { DocsGPTWidget } from "docsgpt";
import "docsgpt/dist/style.css";
```
Then you can use it like this: `<DocsGPTWidget />`
DocsGPTWidget takes 3 props:
- `apiHost` - url of your DocsGPT API
- `selectDocs` - documentation that you want to use for your widget (eg. `default` or `local/docs1.zip`)
- `apiKey` - usually its empty
### How to use DocsGPTWidget with [Nextra](https://nextra.site/) (Next.js + MDX)
Install you widget as described above and then go to your `pages/` folder and create a new file `_app.js` with the following content:
```js
import { DocsGPTWidget } from "docsgpt";
import "docsgpt/dist/style.css";
export default function MyApp({ Component, pageProps }) {
return (
<>
<Component {...pageProps} />
<DocsGPTWidget selectDocs="local/docsgpt-sep.zip/"/>
</>
)
}
```