Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Documentation requested for using botkit-cms as component Botkit App #8

Open
cakriwut opened this issue Dec 31, 2018 · 11 comments
Open
Labels
help wanted Extra attention is needed

Comments

@cakriwut
Copy link

Hi,

I tried to follow starting guide - adding botkit-cms as component in Botkit App. Unfortunately I can not make it works. Here are my steps:

  1. I install botkit and create by first botkit app
   npm install -g botkit
   botkit new --platform web
  1. I cd to the new botkit app folder and run following command
   npm install --save botkit-cms
  1. I modify bot.js , and add following lines:
   var controller = Botkit.socketbot(bot_options);
   var cms = require('botkit-cms')();
   cms.useLocalStudio(controller);
   cms.loadScriptsFromFile(__dirname + '/scripts.json'); // How I can get scripts.json ??

I believe I don't see any scripts.json , and I am not sure if my understanding to register new component is correct.
Would anyone help me and guide me what should I do to configure botkit-cms web?

Thanks.

Riwut

@nick-solly
Copy link

You could copy the file botkit-cms/.data/sample_scripts.json from the library to your project root as scripts.json.

I also then had to add a block in the skills folder to actually use the Studio scripts:

  controller.on('message_received', function(bot, message) {
    controller.studio.runTrigger(bot, message.text, message.user, message.channel).catch(function(err) {
        bot.reply(message, {text: 'Sorry, I don\'t understand.'});
    });
  });

@peterswimm peterswimm added the help wanted Extra attention is needed label Jan 2, 2019
@KristlyDsena
Copy link

how i access CMS

@Oxicode
Copy link

Oxicode commented Feb 12, 2019

how i access CMS

+1

@peterswimm
Copy link
Contributor

@KristlyDsena @Oxicode can you be more specific in your questions?

@benbrown
Copy link
Contributor

I'm not sure if this is answering your question, @Oxicode @KristlyDsena, but when run as a local component, you do not get the CMS UI. You would run a separate instance of the stand-alone CMS to get the editor UI.

@GiselleCastillo5
Copy link

helpp with that, do you know a command of how to start botkit CMS?

@vitogit
Copy link
Contributor

vitogit commented Feb 19, 2019

@GiselleCastillo5 @Oxicode @KristlyDsena
Clone and install botkit-cms

git clone https://github.com/howdyai/botkit-cms.git
cd botkit-cms
npm install

Create an .env file from .env_sample and paste content

cp .env_sample .env
PLATFORM=web
TOKENS=youwillneverguessmysecretbottoken
USERS=admin:123secret

Create .data folder, create a scripts.json inside. Copy the content from sample-scripts.json

mkdir .data
cp sample_scripts.json .data/scripts.json

Run cms and open localhost:3000/admin

npm run build
npm start

Enter the credentials from env vars (admin 123secret)

@benbrown
Copy link
Contributor

@vitogit this is mostly correct, though you would not want to put the environment variables in your .bash_profile -- that would make them available to all applications you run. They should live in the environment only for that app -- either in the .env file, or in some other secure key manager provided by your hosting environment.

@vitogit
Copy link
Contributor

vitogit commented Feb 19, 2019

@benbrown agree, I updated my answer.
This was just me trying to hack some bot really quick, I didn't saw the .env_sample file.

@vitogit
Copy link
Contributor

vitogit commented Feb 19, 2019

I created a PR in case that info could be useful to others #15 but I couldn't add a reviewer.

@Precioushp
Copy link

Run cms and open localhost:3000/admin

npm run build
npm start

how do you do this exactly???

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

9 participants