Skip to content

Commit

Permalink
Embed web3go AI bot in docs (#222)
Browse files Browse the repository at this point in the history
* added web3go bot client modules scripts in docusaurus config

* - added web3go config
- fixed `reference window variable` error while starting the app

---------

Co-authored-by: Deepanshu Gupta <[email protected]>
  • Loading branch information
deepcrazy and Deepanshu Gupta authored Nov 6, 2023
1 parent cd776ce commit ef30526
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ const config = {
deploymentBranch: 'gh-pages',
trailingSlash: false,

clientModules: [
require.resolve('./embedValue.js'),
],
scripts: [
{
src: 'https://reiki.web3go.xyz/aiweb/embed.js',
id: "F03vpUuT3em6KopZ",
defer: true,
},
],

plugins: [
require.resolve("docusaurus-plugin-image-zoom"),

Expand Down
9 changes: 9 additions & 0 deletions embedValue.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import ExecutionEnvironment from "@docusaurus/ExecutionEnvironment";

if (ExecutionEnvironment.canUseDOM) {
// Load Web3Go bot config as soon as site loads in the browser.
window.dinChatbotConfig = {
token: "F03vpUuT3em6KopZ",
api: "https://reiki.web3go.xyz/aiweb",
};
}

0 comments on commit ef30526

Please sign in to comment.