howdyai / botkit-starter-web

Botkit Anywhere - a starter kit for building a bot that lives in your website or app
https://botkit.ai
MIT License
113 stars 75 forks source link

Integrate botkit web with botkit CMS tool #62

Open dhgokul opened 3 years ago

dhgokul commented 3 years ago

Please provide code snippet or steps to use botkit CMS tool in botkit web code. as of now we running botkit CMS from source

https://github.com/howdyai/botkit-cms

I am not able to use this code in bot.js (web)

controller.use(new BotkitCMSHelper({ uri: process.env.CMS_URI, token: process.env.CMS_TOKEN }));

// use the cms to test remote triggers controller.on('message', async(bot, message) => { await controller.plugins.cms.testTrigger(bot, message); });

Any help appreciated !

kareemgdiab commented 3 years ago

I just got it working by doing the following:

settings some .env params in CMS and Botkit

in CMS, set PLATFORM=web set USERS="username:password" set TOKENS="token" set PORT=3001

in Botkit, set CMS_URI=http://localhost:3001 set CMS_TOKEN=token

now run both projects.

keep in mind that you will need to restart Botkit server after saving changes in CMS

dhgokul commented 3 years ago

@kareemgdiab Thanks for your response! Still we get same interconnection issue