{"id":27948424,"url":"https://github.com/twilio-labs/sample-autopilot-support-bot","last_synced_at":"2025-05-07T14:58:30.645Z","repository":{"id":40774139,"uuid":"233141306","full_name":"twilio-labs/sample-autopilot-support-bot","owner":"twilio-labs","description":"This sample application shows how to build an automated SMS chatbot using Twilio's autopilot","archived":false,"fork":false,"pushed_at":"2024-12-06T18:14:18.000Z","size":1008,"stargazers_count":9,"open_issues_count":28,"forks_count":4,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-05-07T14:58:25.338Z","etag":null,"topics":["autopilot","bot","code-exchange","nlp","nodejs","twilio"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/twilio-labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-10T22:32:41.000Z","updated_at":"2024-04-16T04:02:45.000Z","dependencies_parsed_at":"2023-02-14T12:02:55.002Z","dependency_job_id":null,"html_url":"https://github.com/twilio-labs/sample-autopilot-support-bot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"twilio-labs/sample-template-nodejs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twilio-labs%2Fsample-autopilot-support-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twilio-labs%2Fsample-autopilot-support-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twilio-labs%2Fsample-autopilot-support-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twilio-labs%2Fsample-autopilot-support-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/twilio-labs","download_url":"https://codeload.github.com/twilio-labs/sample-autopilot-support-bot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252902627,"owners_count":21822258,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autopilot","bot","code-exchange","nlp","nodejs","twilio"],"created_at":"2025-05-07T14:58:28.049Z","updated_at":"2025-05-07T14:58:30.636Z","avatar_url":"https://github.com/twilio-labs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003ca  href=\"https://www.twilio.com\"\u003e\n\u003cimg  src=\"https://static0.twilio.com/marketing/bundles/marketing/img/logos/wordmark-red.svg\"  alt=\"Twilio\"  width=\"250\"  /\u003e\n\u003c/a\u003e\n \n# Twilio SMS Support Chatbot\n\n[![Actions Status](https://github.com/twilio-labs/sample-autopilot-support-bot/workflows/Node%20CI/badge.svg)](https://github.com/twilio-labs/sample-autopilot-support-bot/actions)\n\n## About\n\nThis sample application shows how to build an automated SMS chatbot using Twilio's autopilot\n\nImplementations in other languages:\n\n| .NET | Java | Python | PHP | Ruby |\n| :--- | :--- | :----- | :-- | :--- |\n| TBD  | TBD  | TBD    | TBD | TBD  |\n\n### How it works\n\nAfter the user sets and submits the configuration parameters on the `/config` page, the sample will automatically create an Autopilot assistant with predefined Tasks and actions using Twilio's REST API. Then, the user can send a text message to the configure phone number to start the conversation. The bot will ask the user for specific input to provide a proper response.\n\n## Features\n\n- Node.js web server using [Express.js](https://npm.im/express)\n- Basic web user interface using [Pug](https://npm.im/pug) for templating and Bootstrap for UI\n- User interface to configure some SMS parameters.\n- Sms parameters can be stored in a JSON database using lowdb.\n- Unit tests using [`mocha`](https://npm.im/mocha) and [`chai`](https://npm.im/chai)\n- [Automated CI testing using GitHub Actions](/.github/workflows/nodejs.yml)\n- Linting and formatting using [ESLint](https://npm.im/eslint) and [Prettier](https://npm.im/prettier)\n- Interactive configuration of environment variables upon running `npm run setup` using [`configure-env`](https://npm.im/configure-env)\n- Project specific environment variables using `.env` files and [`dotenv-safe`](https://npm.im/dotenv-safe) by comparing `.env.example` and `.env`.\n- One click deploy buttons for Heroku and Glitch\n\n## Set up\n\n### Requirements\n\n- [Node.js](https://nodejs.org/)\n- A Twilio account - [sign up](https://www.twilio.com/try-twilio)\n\n### Twilio Account Settings\n\nThis application should give you a ready-made starting point for writing your\nown SMS chatbot application. Before we begin, we need to collect\nall the config values we need to run the application:\n\n| Config\u0026nbsp;Value | Description                                                                                                                                                  |\n| :---------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Account\u0026nbsp;Sid  | Your primary Twilio account identifier - find this [in the Console](https://www.twilio.com/console).                                                         |\n| Auth\u0026nbsp;Token   | Used to authenticate - [just like the above, you'll find this here](https://www.twilio.com/console).                                                         |\n| Phone\u0026nbsp;number | A Twilio phone number in [E.164 format](https://en.wikipedia.org/wiki/E.164) - you can [get one here](https://www.twilio.com/console/phone-numbers/incoming) |\n\n### Local development\n\nAfter the above requirements have been met:\n\n1. Clone this repository and `cd` into it\n\n```bash\ngit clone git@github.com:twilio-labs/sample-autopilot-support-bot.git\ncd sample-autopilot-support-bot\n```\n\n2. Install dependencies\n\n```bash\nnpm install\nnpm install -g ngrok\n```\n\n3. Set your environment variables\n\n```bash\nnpm run setup\n```\n\nSee [Twilio Account Settings](#twilio-account-settings) to locate the necessary environment variables.\n\n4. Run the application\n\n```bash\nnpm start\n```\n\nAlternatively, you can use this command to start the server in development mode. It will reload whenever you change any files.\n\n```bash\nnpm run dev\n```\n\n5. Once you have your server running, you need to expose your `localhost` to a public domain so the Twilio aurtopilot can reach the expected endpoint. This is easy using `ngrok`:\n```\nngrok http 3000\n``` \nThis will generate a url similar to: `https://cd2ef758.ngrok.io`\n\n6. Navigate to `/config` preceding with the ngrok url you got earlier to set the SMS params and create the autopilot assistant. **NOTE:** Always submit the configuration using the ngrok url, never with localhost. Otherwise the autopilot assistant won't be able to establish a call with the operator, if you choose that option.\n\n7. (Optional) After submitting the configuration you can go to your [Twilio's Console](https://www.twilio.com/console/autopilot/list) and take a look at at the created autopilot for more details.\n\n8. Send a text message to the phone number provisioned on Twilio to start the conversation!\n\nThat's it!\n\n### Tests\n\nYou can run the tests locally by typing:\n\n```bash\nnpm test\n```\n\n### Cloud deployment\n\nAdditionally to trying out this application locally, you can deploy it to a variety of host services. Here is a small selection of them.\n\nPlease be aware that some of these might charge you for the usage or might make the source code for this application visible to the public. When in doubt research the respective hosting service first.\n\n*Don't forget to set the environmental variables on each hosting service!*\n\n| Service                           |                                                                                                                                                                                                                           |\n| :-------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| [Heroku](https://www.heroku.com/) | [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://www.heroku.com/deploy/?template=https://github.com/twilio-labs/sample-autopilot-support-bot/tree/master)                                                                                                                                       |\n| [Glitch](https://glitch.com)      | [![Remix on Glitch](https://cdn.glitch.com/2703baf2-b643-4da7-ab91-7ee2a2d00b5b%2Fremix-button.svg)](https://glitch.com/edit/#!/remix/clone-from-repo?REPO_URL=https://github.com/twilio-labs/sample-autopilot-support-bot.git) |\n\nHere are some notes about the services:\n- **Heroku**: Very straightforward, just create an account and after clicking the deploy button you need to follow the instructions and that's it.\n- **Glitch**: It requirers an additional step. Once you click on the deploy button, you need to manually create the file `.env` and set the variables. You can duplicate the `.env.example` file and edit it accordingly.\n\n## Resources\n- This project was generated using this [sample NodeJS template](https://github.com/twilio-labs/sample-template-nodejs)\n\n- [GitHub's repository template](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-from-a-template) functionality\n\n## Contributing\n\nThis template is open source and welcomes contributions. All contributions are subject to our [Code of Conduct](https://github.com/twilio-labs/.github/blob/master/CODE_OF_CONDUCT.md).\n\n[Visit the project on GitHub](https://github.com/twilio-labs/sample-autopilot-support-bot)\n\n## License\n\n[MIT](http://www.opensource.org/licenses/mit-license.html)\n\n## Disclaimer\n\nNo warranty expressed or implied. Software is as is.\n\n[twilio]: https://www.twilio.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwilio-labs%2Fsample-autopilot-support-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwilio-labs%2Fsample-autopilot-support-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwilio-labs%2Fsample-autopilot-support-bot/lists"}