1.0.5 • Published 3 years ago

generator-glip-bot v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

generator-glip-bot NPM version

Generate a Glip chatbot

Installation

First, install Yeoman and generator-glip-bot using npm (we assume you have pre-installed node.js).

npm install -g yo
npm install -g generator-glip-bot

Then generate your new project:

yo glip-bot

Starting bot

Create bot and get credentials

Create bot

Start ngrok to get a public address

This step is optional if you have other ways to get your bot a public address. For example, you might have an VPS with public IP address. But ngrok is pretty handy during development phase:

yarn ngrok

Please take a note of the public address with scheme "https", it should be in the form of https://xxxxx.ngrok.io. We will need it soon.

Port 3000 is where we run our bot's Express.js process.

In content below, we call this public address https://<chatbot-server>.

Specify environment variables:

Create .env files:

cp sample.env .env
  • RINGCENTRAL_SERVER, use https://platform.dev.ringcentral.com for sandbox and https://platform.ringcentral.com for production
  • RINGCENTRAL_CHATBOT_DATABASE_CONNECTION_URI, please sepcify connection URI to a relational database.
    • It is recommended to use SQLite for development: sqlite://./db.sqlite
  • RINGCENTRAL_CHATBOT_CLIENT_ID & RINGCENTRAL_CHATBOT_CLIENT_SECRET could be found in the newly created RingCentral app.
  • RINGCENTRAL_CHATBOT_SERVER is the public address generated by ngrok
    • For example, https://xxxxx.ngrok.io
    • For produciton, you might put your app behind nginx/apache and use the public address of those HTTP servers.
  • RINGCENTRAL_CHATBOT_EXPRESS_PORT is the port we used for Express.js. It should match the ngrok command above.
  • RINGCENTRAL_CHATBOT_ADMIN_USERNAME & RINGCENTRAL_CHATBOT_ADMIN_PASSWORD are the admin username and password.
    • Admin is the bot admin. It's normally the bot creator or maintainer.

Create database tables

curl -X PUT -u admin:password https://<chatbot-server>/admin/setup-database

admin & password are defined in .env file we created above.

For more information, please read setup database.

Add the bot to Glip

Follow these steps to add the bot to Glip.

Start Developing

yarn start:dev

Getting To Know Yeoman

  • Yeoman has a heart of gold.
  • Yeoman is a person with feelings and opinions, but is very easy to work with.
  • Yeoman can be too opinionated at times but is easily convinced not to be.
  • Feel free to learn more about Yeoman.

License

MIT © Jackson Melcher

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago