{"id":15107946,"url":"https://github.com/ciricc/easyvk","last_synced_at":"2025-09-27T06:32:26.772Z","repository":{"id":57218961,"uuid":"113666174","full_name":"ciricc/easyvk","owner":"ciricc","description":"This app helps you create an apps with vk api easy!","archived":true,"fork":false,"pushed_at":"2021-12-31T01:11:22.000Z","size":6437,"stargazers_count":101,"open_issues_count":3,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-09-21T15:33:37.650Z","etag":null,"topics":["api","callback-api","longpoll","nodejs","npm","npm-module","sdk","snippets","streaming-api","vk","vk-api"],"latest_commit_sha":null,"homepage":null,"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/ciricc.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":"2017-12-09T12:03:37.000Z","updated_at":"2024-07-20T18:22:13.000Z","dependencies_parsed_at":"2022-08-29T02:11:51.664Z","dependency_job_id":null,"html_url":"https://github.com/ciricc/easyvk","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ciricc%2Feasyvk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ciricc%2Feasyvk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ciricc%2Feasyvk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ciricc%2Feasyvk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ciricc","download_url":"https://codeload.github.com/ciricc/easyvk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219871956,"owners_count":16554471,"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":["api","callback-api","longpoll","nodejs","npm","npm-module","sdk","snippets","streaming-api","vk","vk-api"],"created_at":"2024-09-25T21:43:24.354Z","updated_at":"2025-09-27T06:32:26.423Z","avatar_url":"https://github.com/ciricc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"EasyVK logo\" title=\"EasyVK can help you create applications on VKontakte API easy!\" src=\"https://i.imgur.com/5P6VNOq.png\" width=\"300\"/\u003e\n\u003c/p\u003e\n\n# EasyVK (VKontakte API Manager) v2.0 (DEPRECATED)\n\n## This package has been deprecated and will no longer be supported.\n\nThis library helps you easily create a javascript application with VKontakte API!\nOfficial VK API: [vk.com/dev/](https://vk.com/dev/)\n\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/cfce75d7342d487c8b8766b7d2085d1d)](https://www.codacy.com/app/ciricc/easyvk?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=ciricc/easyvk\u0026amp;utm_campaign=Badge_Grade) [![Build Status](https://travis-ci.org/ciricc/easyvk.svg?branch=master)](https://travis-ci.org/ciricc/easyvk) [![Downloads](https://img.shields.io/npm/dt/easyvk.svg?style=flat)](https://npms.io/search?q=easyvk) [![Issues](https://img.shields.io/github/issues/ciricc/easyvk.svg?style=flat)](https://github.com/ciricc/easyvk/issues)\n[![Node version support](https://img.shields.io/node/v/easyvk.svg?style=flat)](https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V10.md#10.15.3) [![Npm version released](https://img.shields.io/npm/v/easyvk.svg?style=flat)](https://www.npmjs.com/package/easyvk)\n\n| [Community](https://vk.com/club162208999) | [Документация на русском](https://ciricc.github.io/) |\n| ------------------------------------------| -------------|\n\n## Для русскоязычных\n\nДанная библиотека создана для того, чтобы VKontakte API имел удобную поддержу на node.js.\nС помощью этой библиотеки вы можете делать все, что позволяет официально ВКонтакте API, и не только.\nТак как я предполагаю, что большинство людей, кто скачивает - владеют русским с рождения, то я написал [документацию](https://ciricc.github.io/) для этого модуля на этом языке. \nЕсли вы хотите помочь в развитии этой библиотеки, вступайте в наше [сообщество](https://vk.com/club162208999) и предлагайте, что можно улучшить и добавить. \nЕсли вы хотите помочь нам кодом - делайте это на [github](https://github.com/ciricc/easyvk).\nНиже написано, что можно делать при помощи EasyVK.\n\n## Installing\n\nDownload and install Node.js. Create a project and install `easyvk` with `npm`:\n\n```sh\nnpm i easyvk --save\n```\n\n### Yarn installation\nIf you are using a yarn package manager, you can add easyvk to project so\n```sh\nyarn add easyvk\n```\n\n## Example usage\n\nYou can test the library without installing on [npm runkit](https://npm.runkit.com/easyvk).\nCopy this code and paste it in the code area, don't forget to change username and password.\n\n```javascript\n\nconst easyvk = require(\"easyvk\")\n\n//Authenticating user\neasyvk({\n   username: 'your_login',\n   password: 'your_password',\n   save: false,\n\n   // By default are vk android credentials \n   clientId: 'YOUR_CLIENT_ID',\n   clientSecret: 'YOUR_CLIENT_SECRET'\n}).then(vk =\u003e {\n  \n   //Getting user id from authenticated session\n   let me = vk.session.user_id || 356607530 //Or your account id\n   \n   //Sending a message using messages.send method\n   vk.call('messages.send', {\n      message: 'Hi',\n      user_id: me,\n      random_id: easyvk.randomId()\n   }).then((vkr) =\u003e console.log(vkr))\n   \n}).catch(console.error)\n\n\n```\n\n## EasyVK can help you\n\n*   \u003cb\u003e Create Bots \u003c/b\u003e\n*   Manage groups\n*   Use LongPoll: \u003cb\u003eBots LongPoll (groups) and User LongPoll\u003c/b\u003e\n*   Create high loading projects with \u003cb\u003ehighload mode\u003c/b\u003e\n*   Use \u003cb\u003eCallback API\u003c/b\u003e (like creating your server to listen to group events)\n*   Manage your stream based on official \u003cb\u003eStreaming API\u003c/b\u003e, listen to events and collect data to create statistic and metrics\n*   Upload your files to the server\n*   Call official \u003cb\u003eVKontakte API methods\u003c/b\u003e\n*   Use my widgets - non-official instruments for everyday tasks\n*   Use helpers - utility for creating something that you need everyday\n*   Use saved session, cache data to saved session\n*   Catch errors like Captcha error and others\n*   Configure all that you want or not (utils can bee disabled or enabled by you)\n\n## EasyVK provide\n\n*   \u003cb\u003ePromises and async / await based library\u003c/b\u003e\n*   Authentication support: groups, users, applications, password + username\n*   Informative documentation\n*   Regular updates and support for newest features\n*   Two factor authentication support\n*   Easy working with captcha errors and captcha handlers\n*   Easy customize your requests and easy control them\n\n\nYou can read documentation \u003ca href=\"https://ciricc.github.io/\"\u003ehere\u003c/a\u003e\n\n\n## Что дает EasyVK\n\nУзнайте, зачем Вам может понадобиться Easy VK, и что именно он может вам дать!\n\n### Режим параллельных запросов\n\nВ Easy VK есть режим `highload`, включая который, вы сможете использовать все возможности API ВКонтакте даже при большом количестве запросов. Этот режим дает знать библиотеке, что все запросы необходимо выполнять через метод execute, который выполняет до 25 запросов в секунду.\n\nМожет пригодиться чат-ботам, в которых сообщений в тысячи раз больше, чем пользователей.\n\n```javascript\neasyvk({\n  token: \"{GROUP_TOKEN}\",\n  reauth: true,\n  mode: 'highload' || {\n    timeout: 10,\n    name: 'highload'\n  }\n}).then(async (vk) =\u003e {\n  \n  let connection = await vk.bots.longpoll.connect();\n\n  connection.on('message_new', console.log);\n\n});\n```\n\n### Плагины\n\nТеперь в Easy VK будет поддерживаться разработка новых плагинов. Функционал API для плагинов будет дополняться по мере просьб и нужд разработчиков, я всегда буду рад обновлениям.\n\n```javascript\n  \n  // Разработка простейшего плагина для отправки сообщений\n  vk.use(async ({thread, next}) =\u003e {\n    if (thread.method == \"messages.send\") {\n      // Автоматически меняем типа запроса на POST\n      thread.methodType = \"post\";\n\n      if (Number(thread.query.v) \u003e= 5.90) {\n\n        /* Для новых версий API ВКонтакте для сообщений \n           требует поля random_id (уникальный id сообщения) */\n        thread.query.random_id = easyvk.randomId(); \n      }\n\n    }\n\n    // Запускаем следующий плагин\n    await next();\n  });\n\n```\n\n### Client Credentials Flow и авторизация по приложению\n\n```javascript\n\n  easyvk({\n    clientId: '{APP_SECRET_CODE}',\n    clientSecret: '{CLIENT_SECRET_CODE}',\n    utils: {\n      streamingAPI: true\n    }\n  }).then((vk) =\u003e {\n\n    const StreamingAPI = vk.streamingAPI\n\n    return StreamingAPI.connect().then((connection) =\u003e {\n\n      connection.getRules().then((vkr) =\u003e {\n        console.log(vkr.rules);\n      });\n      \n      connection.on(\"post\", console.log);\n\n    });\n  });\n\n```\n\n### LongPoll API\n\nСоздавайте своих чат-ботов с помощью Easy VK и его возможностей LongPoll API\n\n```javascript\n  \n  //bots\n  vk.bots.longpoll.connect({\n    forGetLongPollServer: {\n      grop_id: vk.session.group_id\n    }\n  }).then((connection) =\u003e {\n    \n    connection.on(\"message_new\", (msg) =\u003e {\n      \n      //On message event\n      vk.call(\"messages.send\", {\n        peer_id: msg.from_id,\n        message: \"Reply it!\",\n        random_id: easyvk.randomId()\n      }).catch(console.error);\n\n    });\n\n  });\n\n  //user longpoll\n  vk.longpoll.connect({}).then((connection) =\u003e {\n    connection.on(\"message\", (event) =\u003e {\n      console.log(event);\n    });\n  \n    //changed state of message\n    connection.addEventCodeListener(3, (eventChangeState) =\u003e {\n      console.log(eventChangeState);\n    });\n  });\n\n\n```\n\n### Streaming API\n\nСобирайте статистические данные о популярности тех или инных продуктов, проектов - чего угодно! Это позволит Вам знать, о чем пишут пользователи ВКонтакте, и кто из них - ваши клиенты!\n\n```javascript\n    \n  easyvk({\n    clientId: '{APP_SECRET_CODE}',\n    clientSecret: '{CLIENT_SECRET_CODE}',\n    utils: {\n      streamingAPI: true\n    }\n  }).then(vk =\u003e {\n    vk.streamingAPI.connect((stream) =\u003e {\n        \n      stream.initRules({\n        key1: 'кошка',\n        key2: 'собака -кот'\n      }).then((changes) =\u003e {\n        \n        console.log(changes.changedRules, changes.deletedRules, changes.addedRules);\n\n        stream.on(\"post\", (postEvent) =\u003e {\n          console.log(\"Post info: \", postEvent);\n        });\n        \n        //.on(...)\n        //.on(\"share\")\n        //.on(\"comment\") etc...\n      });\n\n    });\n  })\n\n```\n\n### Callback API\n\nСоздавайте чат-ботов (и не только) с помощью Callback API, имея собственный сервер с открытым доступом в интернете.\n\n```javascript\n\n  easyvk.callbackAPI.listen({\n    port: process.env.PORT || 8080,\n    groups: [\n      {\n        groupId: 11,\n        confirmCode: 'TestConfirmationCode',\n        secret: 'GroupPassword'\n      },\n      {\n        /*....*/\n      }\n    ]\n  }).then((connection) =\u003e {\n    \n    connection.on('message_new', (msg) =\u003e {\n        console.log(msg.group_id);\n    });\n\n  }).catch(console.error);\n\n```\nВсе остальное находится на \u003ca href=\"https://ciricc.github.io/\"\u003eсайте-документации\u003c/a\u003e проекта.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fciricc%2Feasyvk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fciricc%2Feasyvk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fciricc%2Feasyvk/lists"}