{"id":15683572,"url":"https://github.com/jonchurch/botkit-middleware-lex","last_synced_at":"2025-11-09T03:04:01.887Z","repository":{"id":103622918,"uuid":"90302283","full_name":"jonchurch/botkit-middleware-lex","owner":"jonchurch","description":"Use AWS Lex service with Botktit","archived":false,"fork":false,"pushed_at":"2019-10-16T14:15:04.000Z","size":16,"stargazers_count":10,"open_issues_count":1,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-07T13:07:22.472Z","etag":null,"topics":["aws-lex","botkit","chatbot"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonchurch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-04T19:31:41.000Z","updated_at":"2023-12-19T17:40:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"f204386e-ad4d-44e6-944c-33a65fbed0e4","html_url":"https://github.com/jonchurch/botkit-middleware-lex","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonchurch%2Fbotkit-middleware-lex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonchurch%2Fbotkit-middleware-lex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonchurch%2Fbotkit-middleware-lex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonchurch%2Fbotkit-middleware-lex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonchurch","download_url":"https://codeload.github.com/jonchurch/botkit-middleware-lex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252883204,"owners_count":21819160,"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":["aws-lex","botkit","chatbot"],"created_at":"2024-10-03T17:07:17.661Z","updated_at":"2025-11-09T03:04:01.839Z","avatar_url":"https://github.com/jonchurch.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Overview\n\nThis middleware allows you to send user input to AWS Lex. This gives you access to intent mapping, data slots, NLP, and other capabilites of the Lex service. You can use this middleware to extend your bots capabilites, add an interaction that lives in Lex to an existing bot, or to run a Lex bot with Botkit as the connector.\n\n## Setup\n\nYou will need an AWS Lex bot setup. Note the BotName, BotAlias, and AWS region when creating your Lex bot.\n\nIn order to use the aws-sdk LexRuntime, you will need to have your aws access keys [configured properly for nodejs](http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/getting-started-nodejs.html)\n\n## Message Object\n\nAdds data returned from the Lex api PostText method to incoming message object. Learn more about the PostText method [here](http://docs.aws.amazon.com/lex/latest/dg/API_runtime_PostText.html)\n\n\n```\n\n        message.lex = {\n            intent: 'STRING',\n            slots: 'OBJECT',\n            session: 'OBJECT' \n            message: 'STRING',\n            dialogState: 'STRING',\n            slotToElicit: 'STRING'\n        }\n```\n\n\n## Example Usage Recieve Middleware\n\n```\nvar lex = require('botkit-middleware-lex')({\n  botName: 'BotkitLex',\n  botAlias: 'blex',\n  region: 'us-east-1'\n})\n\nmodule.exports = function(controller) {\n  \n  controller.middleware.receive.use(lex.receive)\n\n// Respond to all incoming text messages with the response from Lex\n  controller.on('message_received', function(bot, message) {\n    if (message.text) {\n            bot.reply(message, message.lex.message)\n        }   \n  })\n}\n```\n## Example Usage Hears Middleware\n\n```\nvar lex = require('botkit-middleware-lex')({\n  botName: 'BotkitLex',\n  botAlias: 'blex',\n  region: 'us-east-1'\n})\n\nmodule.exports = function(controller) {\n  \n  controller.middleware.receive.use(lex.receive)\n\n // listen for a specific Lex Intent\n  controller.hears(['default_intent'], 'message_received', function(bot, message) {\n    if (message.text) {\n            bot.reply(message, message.lex.message)\n        }   \n  })\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonchurch%2Fbotkit-middleware-lex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonchurch%2Fbotkit-middleware-lex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonchurch%2Fbotkit-middleware-lex/lists"}