{"id":13400792,"url":"https://github.com/fletcherist/yandex-dialogs-sdk","last_synced_at":"2026-04-06T09:12:36.068Z","repository":{"id":57403086,"uuid":"125618257","full_name":"fletcherist/yandex-dialogs-sdk","owner":"fletcherist","description":"☂️Build your skill for Yandex.Alice with ease. (nodejs/typescript)","archived":false,"fork":false,"pushed_at":"2020-04-26T21:13:00.000Z","size":467,"stargazers_count":122,"open_issues_count":4,"forks_count":16,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-10-04T06:46:20.515Z","etag":null,"topics":["alice","alice-sdk","alisa","yandex-alisa","yandex-dialogs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/fletcherist.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-03-17T10:26:39.000Z","updated_at":"2024-06-24T05:19:18.000Z","dependencies_parsed_at":"2022-09-18T11:52:42.283Z","dependency_job_id":null,"html_url":"https://github.com/fletcherist/yandex-dialogs-sdk","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/fletcherist/yandex-dialogs-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fletcherist%2Fyandex-dialogs-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fletcherist%2Fyandex-dialogs-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fletcherist%2Fyandex-dialogs-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fletcherist%2Fyandex-dialogs-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fletcherist","download_url":"https://codeload.github.com/fletcherist/yandex-dialogs-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fletcherist%2Fyandex-dialogs-sdk/sbom","scorecard":{"id":403103,"data":{"date":"2025-08-11","repo":{"name":"github.com/fletcherist/yandex-dialogs-sdk","commit":"ccf2cb294e02ef08824a726b3d229f0b9c54982a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4,"checks":[{"name":"Code-Review","score":3,"reason":"Found 7/20 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 19 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T20:32:41.504Z","repository_id":57403086,"created_at":"2025-08-18T20:32:41.512Z","updated_at":"2025-08-18T20:32:41.512Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31466228,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-06T08:36:52.050Z","status":"ssl_error","status_checked_at":"2026-04-06T08:36:51.267Z","response_time":112,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["alice","alice-sdk","alisa","yandex-alisa","yandex-dialogs"],"created_at":"2024-07-30T19:00:55.500Z","updated_at":"2026-04-06T09:12:36.051Z","avatar_url":"https://github.com/fletcherist.png","language":"TypeScript","funding_links":[],"categories":["Разработка"],"sub_categories":["SDK"],"readme":"# yandex-dialogs-sdk\n[![npm version](https://badge.fury.io/js/yandex-dialogs-sdk.svg)](https://badge.fury.io/js/yandex-dialogs-sdk)\n\n*Note: this is an open-source project. It is not affiliated with Yandex LLC.*\n\nTiny zen library to create skills for Yandex.Alice\n\n**[yandex-dialogs-sdk](https://t.me/joinchat/AeqRLxKsMmI4o1ew2lQ1Qw)** — Telegram chat, if you need help\n\n\u003cimg height=200 src='https://camo.githubusercontent.com/0ad462b08ffb18f96ae1143f1365b60b918f4bbd/68747470733a2f2f73657470686f6e652e72752f77702d636f6e74656e742f75706c6f6164732f323031372f30372f616c6973612d383130783435362e706e67' /\u003e\n\n\n#### Install SDK\n`npm i yandex-dialogs-sdk --save`\n\n\u003e To enable debug mode run `DEBUG=yandex-dialogs-sdk node YOUR_APP.js`\n\n#### Videotutorials\n- [Роман Парадеев — Доклад с конференции «В гостях у Алисы»](https://youtu.be/qqHTk2QLyEQ?t=3h13m22s)\n- [Фил Романов — Пишем игру Guess Number за 10 минут](https://youtu.be/exPnIFMa1H8)\n\n\n## 🔨 Built with SDK\n\n- [yandex-dialogs-whatis](https://github.com/popstas/yandex-dialogs-whatis) \nSmart reminder by [@popstas](https://github.com/popstas)\n- [Алиса в стране диез](https://github.com/AntonRzevskiy/Alice-in-the-country-sharp)\nAwesome music game by [@AntonRzevskiy](https://github.com/AntonRzevskiy)\n- [Adventure Engine](https://github.com/Teoreez/Adventure-Engine---YandexAlice-MongoDB-JS)\nAdventure quest game by [@Teoreez](https://github.com/Teoreez)\n- [uraljs-alice-bot](https://github.com/sameoldmadness/uraljs-alice-bot)\nНавык Алисы UralJS\n- [homebot-alisa](https://github.com/homebot/homebot-alisa)\n- Send PR to be here!\n\n#### Getting Started\n\n```javascript\nconst { Alice, Reply, Markup } = require('yandex-dialogs-sdk')\nconst alice = new Alice();\n\nconst M = Markup;\nalice.command('', async ctx =\u003e Reply.text('Look, what i can!'));\nalice.command('Give a piece of advice', async ctx =\u003e\n  Reply.text('Make const not var'),\n);\nalice.command(\n  ['What is trending now?', 'Watch films', 'Whats in the theatre?'],\n  ctx =\u003e {\n    return {\n      text: `What about 50 Angry Men?`,\n      buttons: [M.button('Buy ticket'), M.button('What else?')],\n    };\n  },\n);\nalice.command(/(https?:\\/\\/[^\\s]+)/g, ctx =\u003e Reply.text('Matched a link!'));\nalice.any(async ctx =\u003e Reply.text(`I don't understand`));\nconst server = alice.listen(3001, '/');\n```\n\n#### Hot middlewares from maintainer\n\n- **[yandex-dialogs-sdk-lowdb](https://github.com/fletcherist/yandex-dialogs-sdk-lowdb)** - store your users sessions in file\n- **[yandex-dialogs-sdk-chatbase](https://github.com/popstas/yandex-dialogs-sdk-chatbase)** - send events to Google Chatbase by **[@popstas](https://github.com/popstas)**\n\n#### Handle non-trivial scenarios\n\n```javascript\nconst { Alice, Scene, Stage } = require('yandex-dialogs-sdk')\nconst stage = new Stage();\nconst alice = new Alice();\nconst SCENE_AT_BAR = 'SCENE_AT_BAR';\nconst atBar = new Scene(SCENE_AT_BAR);\n\natBar.command('show menu', ctx =\u003e\n  Reply.text('only vodka here', {\n    buttons: ['buy vodka', 'go away'],\n  }),\n);\natBar.command('buy vodka', ctx =\u003e Reply.text(`you're dead`));\natBar.command('go away', ctx =\u003e {\n  ctx.leave();\n  return Reply.text('as you want');\n});\natBar.any(ctx =\u003e Reply.text(`no money no honey`));\n\nstage.addScene(atBar);\nalice.use(stage.getMiddleware());\nalice.command('i want some drinks', ctx =\u003e {\n  ctx.enter(SCENE_AT_BAR);\n  return Reply.text('lets go into pub', {\n    buttons: ['show menu', 'go away'],\n  });\n});\n```\n\n\u003e A lot of examples in folder **[./examples](https://github.com/fletcherist/yandex-dialogs-sdk/tree/master/examples)**\n\n# API\n\n- [Yandex Dialogs Protocol](https://tech.yandex.ru/dialogs/alice/doc/protocol-docpage/)\n\n###### Alice\n```javascript\nconst { Alice } = require('yandex-dialogs-sdk')\n```\n- `alice.command` - Set handler for command\n- `alice.any` - Set handler if no command has been matched\n```javascript\nalice.command('text', ctx =\u003e null)\nalice.command(/regex/ig, ctx =\u003e null)\nalice.command(['array', 'of', 'strings'], ctx =\u003e null)\n// pass function which returns boolean. True means perfect match.\nalice.command(ctx =\u003e true || false, ctx =\u003e null)\n\nalice.any('text', ctx =\u003e null)\n\n// create event listener\n// triggers when request processing is finished\nalice.on('response', ctx =\u003e {\n  console.log(ctx.response)\n})\n```\n\n###### Images Api\nTo use this API you have to provide your auth data.\n[More info](https://tech.yandex.ru/dialogs/alice/doc/resource-upload-docpage)\n```javascript\nconst alice = new Alice({\n  oAuthToken: OAUTH_TOKEN,\n  skillId: SKILL_ID\n});\n```\n- `alice.imagesApi.uploadImageByUrl` - Upload image by URL\n- `alice.imagesApi.uploadImageFile` - Upload image by File Buffer **(Not implemented yet)**.\n- `alice.imagesApi.getImages` - Get all uploaded images\n- `alice.imagesApi.getImagesQuota` - Get images quota\n- `alice.imagesApi.deleteImage` - Delete image\n```javascript\nconst image = await alice.imagesApi.uploadImageByUrl(IMAGE_URL);\nconst images = await alice.imagesApi.getImages();\n// @example { total: 104857600, used: 25715766 }\nconst quota = await alice.imagesApi.getImagesQuota();\n// @example { result: 'ok' } | { message: 'Image not found' }\nawait alice.imagesApi.deleteImage('IMAGE_ID')\n```\n\n###### Context\n- `[ctx.data]` - object with request\n- `[ctx.message]` — shortcut for `ctx.data.request.command`\n- `[ctx.originalUtterance]` - shortcut for `ctx.data.request.original_utterance`\n- `[ctx.sessionId]` — shortcut for `ctx.data.session.session_id`\n- `[ctx.messageId]` — shortcut for `ctx.data.session.message_id`\n- `[ctx.userId]` — shortcut for `ctx.data.session.user_id`\n- `[ctx.payload]` — shortcut for `ctx.data.request.payload`\n- `[ctx.nlu]` - shortcut for `ctx.data.request.nlu` [(see more)](https://tech.yandex.ru/dialogs/alice/doc/nlu-docpage/)\n- `[ctx.response]` - available only in listeners. appears just before sending a response\n- `[ctx.enter()]` - enters session\n- `[ctx.leave()]` - goes to main dialog\n- `ctx.session.set` - set session value. Session is attached to `user_id`\n- `ctx.session.get` - get session value.\n```javascript\n// enter/leave scene\nconst { Scene } = require('yandex-dialogs-sdk');\nctx.enter('scene-name');\nctx.leave();\n\nctx.session.set('price', 200);\nconst price = ctx.session.get('price'); // 200\n```\n\u003e **[enter/leave example](https://github.com/fletcherist/yandex-dialogs-sdk/blob/master/examples/scenes.js)**\n\n###### Stage\n```javascript\nconst { Stage } = require('yandex-dialogs-sdk')\nconst stage = new Stage()\n```\n- `stage.addScene` - adds scene to stage\n- `stage.removeScene` - removes scene from stage\n- `stage.getMiddleware` - returns stage middleware\n\u003e **[full scene example](https://github.com/fletcherist/yandex-dialogs-sdk/blob/master/examples/scenes.js)**\n\n\n###### Middlewares\n```javascript\nconst createMessagesCounterMiddleware = () =\u003e {\n  let count = 0\n  return async (ctx, next) =\u003e {\n    // You can do anything with context here\n    count += 1;\n    return next(ctx)\n  }\n}\nalice.use(createMessagesCounterMiddleware())\n```\n\n###### Reply\n```javascript\nconst { Reply } = require('yandex-dialogs-sdk')\nIMAGE_ID = '213044/d13b0d86a41daf9de232'\nEXTRA_PARAMS = { // Extra params are optional\n  tts: 'Hi the+re',\n  buttons: ['one', Markup.button('two')],\n  end_session: true\n}\n```\n- `Reply.text` \n```javascript\n// Second argument is optional\nalice.any(ctx =\u003e Reply.text('text'), EXTRA_PARAMS)\n```\n- `Reply.bigImageCard` - One big image\n```javascript\nReply.bigImageCard('text', {\n  image_id: IMAGE_ID,\n  title: string, // optional\n  description: string, // optional\n  button: M.button('click'), // optional\n}, EXTRA_PARAMS)\n```\n- `Reply.itemsListCard` - Gallery\n```javascript\nReply.itemsListCard('text', [IMAGE_ID, IMAGE_ID], EXTRA_PARAMS);\nReply.itemsListCard('test', {\n    header: 'header',\n    footer: {\n      text: 'test',\n      button: Markup.button('button'),\n    },\n    items: [\n      IMAGE_ID, \n      { image_id: IMAGE_ID, title: 'title', description: 'description' },\n    ],\n  });\n```\n\n###### Events\n```javascript\n// create event listener\n// triggers when request processing is finished\nalice.on('response', ctx =\u003e {\n  console.log(ctx.response)\n})\n```\n\n\n###### Markup\n```javascript\nconst { Markup } = require('yandex-dialogs-sdk')\n```\n- `Markup.button`\n```javascript\nconst M = Markup\nM.button('string')\nM.button({\n  title: string;\n  url: string;\n  payload: object;\n  hide: boolean;\n})\n```\n\n## CONTRIBUTING\n`git clone`\n\n`npm install \u0026\u0026 npm run test \u0026\u0026 npm run dev`\n\nTypescript will be compiled into `./dist` \u003cbr\u003e\n\n## Contributors\nThanks all these awesome people for this product. \n\n| [\u003cimg src=\"https://avatars1.githubusercontent.com/u/3027126?s=400\u0026v=4\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eStanislav Popov\u003c/b\u003e\u003c/sub\u003e](http://blog.popstas.ru)\u003cbr /\u003e[📖](https://github.com/fletcherist/yandex-dialogs-sdk/commits?author=popstas \"Documentation\")| [\u003cimg src=\"https://avatars0.githubusercontent.com/u/22147027?s=400\u0026v=4\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eNikita Rogozhin\u003c/b\u003e\u003c/sub\u003e](http://rogoda.ru)\u003cbr /\u003e[📖](https://github.com/fletcherist/yandex-dialogs-sdk/commits?author=rogodec \"Documentation\") | [\u003cimg src=\"https://avatars0.githubusercontent.com/u/1537724?s=400\u0026v=4\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eRoman Paradeev\u003c/b\u003e\u003c/sub\u003e](https://github.com/sameoldmadness)\u003cbr /\u003e[📖](https://github.com/fletcherist/yandex-dialogs-sdk/commits?author=sameoldmadness \"Documentation\") | [\u003cimg src=\"https://avatars2.githubusercontent.com/u/10712045?s=400\u0026v=4\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eVanya Klimenko\u003c/b\u003e\u003c/sub\u003e](http://vanyaklimenko.ru)\u003cbr /\u003e[📖](https://github.com/fletcherist/yandex-dialogs-sdk/commits?author=vanyaklimenko \"Documentation\") | [\u003cimg src=\"https://avatars2.githubusercontent.com/u/577154?s=460\u0026v=4\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDmitry Guketlev\u003c/b\u003e\u003c/sub\u003e](https://github.com/Yavanosta)\u003cbr /\u003e[📖](https://github.com/fletcherist/yandex-dialogs-sdk/commits?author=Yavanosta \"Documentation\") | [\u003cimg src=\"https://avatars1.githubusercontent.com/u/11800710?s=460\u0026v=4\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAlexander Karpov\u003c/b\u003e\u003c/sub\u003e](https://github.com/alexander-karpov)\u003cbr /\u003e[📖](https://github.com/fletcherist/yandex-dialogs-sdk/commits?author=alexander-karpov \"Documentation\") | \n| :---: | :---: | :---: | :---: | :---: | :---: |\n\n\nPhil Romanov © MIT 2018\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffletcherist%2Fyandex-dialogs-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffletcherist%2Fyandex-dialogs-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffletcherist%2Fyandex-dialogs-sdk/lists"}