{"id":15134232,"url":"https://github.com/darkxahtep/vk-auth","last_synced_at":"2025-07-08T07:40:30.372Z","repository":{"id":33380354,"uuid":"37025307","full_name":"DarkXaHTeP/vk-auth","owner":"DarkXaHTeP","description":"Authorization in Vkontakte social network as standalone/mobile application for Node.JS servers","archived":false,"fork":false,"pushed_at":"2017-11-23T00:39:35.000Z","size":34,"stargazers_count":15,"open_issues_count":2,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-30T17:38:30.083Z","etag":null,"topics":["auth","authentication","authorization","nodejs","phantomjs","token","vk","vkontakte","vkontakte-api","vkontakte-client"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/vk-auth","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/DarkXaHTeP.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":"2015-06-07T17:24:41.000Z","updated_at":"2022-12-23T02:46:38.000Z","dependencies_parsed_at":"2022-08-24T18:40:38.916Z","dependency_job_id":null,"html_url":"https://github.com/DarkXaHTeP/vk-auth","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarkXaHTeP%2Fvk-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarkXaHTeP%2Fvk-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarkXaHTeP%2Fvk-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarkXaHTeP%2Fvk-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DarkXaHTeP","download_url":"https://codeload.github.com/DarkXaHTeP/vk-auth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237807482,"owners_count":19369597,"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":["auth","authentication","authorization","nodejs","phantomjs","token","vk","vkontakte","vkontakte-api","vkontakte-client"],"created_at":"2024-09-26T05:03:56.890Z","updated_at":"2025-02-08T12:31:04.638Z","avatar_url":"https://github.com/DarkXaHTeP.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vk-auth\n\nAuthorization in [Vkontakte](http://vk.com/) social network as [standalone/mobile](http://vk.com/dev/standalone) application. Allows you to get vk token with the help of PhantomJS headless browser.\n\n#### npm\n[![NPM Version][npm-image]][npm-url]\n[![NPM Downloads][downloads-image]][downloads-url]\n\n#### Issues\n[![Tasks in Ready](https://badge.waffle.io/DarkXaHTeP/vk-auth.png?label=ready\u0026title=Ready)](https://waffle.io/DarkXaHTeP/vk-auth)\n[![Tasks in Progress](https://badge.waffle.io/DarkXaHTeP/vk-auth.png?label=In%20Progress\u0026title=In%20Progress)](https://waffle.io/DarkXaHTeP/vk-auth)\n\n#### Build information\n[![Build Status](https://travis-ci.org/DarkXaHTeP/vk-auth.svg?branch=master)](https://travis-ci.org/DarkXaHTeP/vk-auth)\n[![Coverage Status](https://coveralls.io/repos/DarkXaHTeP/vk-auth/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/DarkXaHTeP/vk-auth?branch=master)\n\n## Example\nUsing vk-auth is easy enough; it accepts two parameters in it's constructor (applicationId and required permissions) and provides single method for authorization:\n\n``` js\nvar vkAuth = require('vk-auth')(123456, 'audio');\n\nvkAuth.authorize('johndoe@example.com', 'password', function(err, tokenParams) {\n    //do something with access token\n});\n```\n\n## Changelog\nv1.0.6\n* Issue with markup change on permissions page fixed\n* Dependencies are updated\n\nv1.0.5\n* PhantomJS was updated to version 2\n\nv1.0.4\n* Issue with form submit fixed\n\nv1.0.3\n* Updates in VK URLs (thanks to [Dmitriy](https://github.com/IamNotUrKitty))\n* Error messages do not contain new line symbol\n\nv1.0.1-1.0.2\n* Fixes in readme\n\nv1.0.0\n* First release\n* Small code improvements\n* Tests for node.js part of module\n* Daily build to check that module is still working\n\nv0.0.6\n\n* 'error' event is not emited when no listeners attached and callback is present\n\nv0.0.5\n\n* Should work again after VK urls updates\n* Error for wrong credentials is now displayed again\n\nv0.0.4\n\n* PhantomJS is now started by 'execFile' command instead of 'exec'\n\nv0.0.3\n\n* Events added\n\nv0.0.2\n\n* Result format changed to look the same way as vk response\n* All errors including VK and wrong credentials errors are now passed through 'err' callback parameters\n\nv0.0.1\n\n* Initial module version\n\n## Constructor parameters\n#### require('vk-auth')(applicationId, permissions);\nTo get applicationId you need to create vk app [here](https://vk.com/editapp?act=create).\n\nYou can pass app permissions as a string or array e.g.\n```js\nvar permissions = 'friends,video,offline';\nvar anotherPermissons = [\n    'wall',\n    'friends'\n];\n```\nTo get more information about available permissions visit [Application Access Permissions](http://vk.com/dev/permissions) page\n\n## Method parameters\n#### vkAuth.authorize(login, password, callback)\n*Login* - user's email or phone number\n\n*Password* - user's password\n\n*Callback(err, tokenParams)* - accepts two parameters - error and token parameters\n\n## Events\nYou can subscribe to events emitted by authorization module instead of passing callback.\nThere are two events available:\n\n*\"auth\"* - Authorization succeed\n\n*\"error\"* - Error happened during authorization\n\nExample:\n```js\nvar vkAuth = require('vk-auth')(123456, 'audio');\n\nvkAuth.authorize('johndoe@example.com', 'password');\n\nvkAuth.on('error', function(err) {\n    console.log(err);\n});\n\nvkAuth.on('auth', function(tokenParams) {\n    //do something with token parameters\n})\n```\n## Token\nHere is an example of received token parameters:\n```js\n{\n    access_token: 801edadc2f0d1898676e2804ec50b9990801dcd3fd5e9bc197898c19b9d796596d79c03278489f3e88\n    expires_in: 86400\n    user_id: 49923862\n}\n```\nTo read more about this parameters go to [Client Application Authorization](http://vk.com/dev/auth_mobile) page.\n\n## Сontribution\nFeel free to ask questions and post ideas, as well as send pull requests.\nIf you want to support me, leave tip at Gratipay: [![Gratipay][gratipay-image]][gratipay-url]\n\n#### License: [MIT](LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/vk-auth.svg\n[npm-url]: https://npmjs.org/package/vk-auth\n[downloads-image]: https://img.shields.io/npm/dm/vk-auth.svg\n[downloads-url]: https://npmjs.org/package/vk-auth\n[gratipay-image]: https://img.shields.io/gratipay/DarkXaHTeP.svg\n[gratipay-url]: https://gratipay.com/DarkXaHTeP/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkxahtep%2Fvk-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarkxahtep%2Fvk-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkxahtep%2Fvk-auth/lists"}