Flobot is a Slack app that retrieves Typeform responses and posts them to Slack using a given webhook. Flobot is configured to be hosted in Heroku and run as a standalone worker that is scheduled via Heroku's Scheduler. A MongoDB database is being used to save the last time the worker is run to ensure only new Typeform responses are retrieved.
- npm
- node v8.9.4+
- heroku v7.18.3+
-
Run
npm install
, this will create a lock file. -
Run
npm start
to begin the worker process.NOTE:
npm start
should not be used to verify code changes as local environments operate differently than Heroku's. Instead useheroku local
.
Once these changes have been deployed the TYPEFORM_RESPONSES_URL
in constants.js will be called and the responses will be posted via the SLACK_FLOBOT_WEBHOOK
.
If the environment variables are created locally, this code can also be run with npm start
.
NODE_ENV
- Node development environment, either "production" (the production heroku worker environment) or "development"DB_URI
- database URI (the database name, user, and password is required to create the URI)SLACK_FLOBOT_WEBHOOK
- the Slack webhook URLSLACK_FLOBOT_WEBHOOK_TEST
- the Slack webhook URL for testing (optional)TYPEFORM_KEY
- the Typeform Person TokenTYPEFORM_ID
- the ID of the Typeform
To make changes to this PR, adhere to the following process:
- Fork this repository.
- Pull the latest if you've previously forked this repo.
- Create a feature branch.
- Push your branch and create a PR.
- Once your PR is merged it will be deployed to Heroku.
NOTE: Making changes to this repo requires admin access to Black Code Collective's Slack team, Typeform, data store, and collaborator access to the Flobot Heroku app.
Pull Requests are welcome but please open an issue before submitting a PR. In addition please be sure to update tests and this README as appropriate.