mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-13 20:14:16 +00:00
feat(docs): mount the DocsGPT chat widget
Adds a floating "Ask the docs" bubble to every docs page. docsgpt-react was already a dependency but nothing imported it, so no widget rendered. The widget reads window and navigator on mount, so it is lazy-loaded with ssr: false from a client wrapper. Its light/dark theme follows the site toggle via next-themes, promoted here from a transitive dependency to a declared one. The key comes from NEXT_PUBLIC_DOCSGPT_API_KEY and the host from NEXT_PUBLIC_DOCSGPT_API_HOST. With no key set the wrapper renders nothing rather than falling through to the demo key the package defaults to. Bumping docsgpt-react to ^0.7.0 also drops a duplicate React. The old ^0.6.3 pin depended on React 18 and npm installed a nested 18.3.1 beside the app's 19.2.8, which would have thrown an invalid hook call on first render.
This commit is contained in:
1 parent
74b4ae30f9
commit
3711426c83
4 files changed
+55
-65
No files matched your search
+2
-1
@@ -8,8 +8,9 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vercel/analytics": "^2.0.1",
|
||||
"docsgpt-react": "^0.6.3",
|
||||
"docsgpt-react": "^0.7.0",
|
||||
"next": "^16.3.0",
|
||||
"next-themes": "^0.4.6",
|
||||
"nextra": "^4.6.1",
|
||||
"nextra-theme-docs": "^4.6.1",
|
||||
"react": "^19.2.8",
|
||||
|
||||
Reference in new issue
Block a user