|
|
@ -4,7 +4,7 @@
|
|
|
|
Got to your project and install a new dependency: `npm install docsgpt`.
|
|
|
|
Got to your project and install a new dependency: `npm install docsgpt`.
|
|
|
|
|
|
|
|
|
|
|
|
### Usage
|
|
|
|
### Usage
|
|
|
|
Go to your project and in the file where you want to use the widget import it:
|
|
|
|
Go to your project and in the file where you want to use the widget, import it:
|
|
|
|
```js
|
|
|
|
```js
|
|
|
|
import { DocsGPTWidget } from "docsgpt";
|
|
|
|
import { DocsGPTWidget } from "docsgpt";
|
|
|
|
import "docsgpt/dist/style.css";
|
|
|
|
import "docsgpt/dist/style.css";
|
|
|
@ -14,12 +14,12 @@ import "docsgpt/dist/style.css";
|
|
|
|
Then you can use it like this: `<DocsGPTWidget />`
|
|
|
|
Then you can use it like this: `<DocsGPTWidget />`
|
|
|
|
|
|
|
|
|
|
|
|
DocsGPTWidget takes 3 props:
|
|
|
|
DocsGPTWidget takes 3 props:
|
|
|
|
- `apiHost` — url of your DocsGPT API.
|
|
|
|
- `apiHost` — URL of your DocsGPT API.
|
|
|
|
- `selectDocs` — documentation that you want to use for your widget (eg. `default` or `local/docs1.zip`).
|
|
|
|
- `selectDocs` — documentation that you want to use for your widget (e.g. `default` or `local/docs1.zip`).
|
|
|
|
- `apiKey` — usually its empty.
|
|
|
|
- `apiKey` — usually it's empty.
|
|
|
|
|
|
|
|
|
|
|
|
### How to use DocsGPTWidget with [Nextra](https://nextra.site/) (Next.js + MDX)
|
|
|
|
### 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:
|
|
|
|
Install your widget as described above and then go to your `pages/` folder and create a new file `_app.js` with the following content:
|
|
|
|
```js
|
|
|
|
```js
|
|
|
|
import { DocsGPTWidget } from "docsgpt";
|
|
|
|
import { DocsGPTWidget } from "docsgpt";
|
|
|
|
import "docsgpt/dist/style.css";
|
|
|
|
import "docsgpt/dist/style.css";
|
|
|
|