{"id":15133874,"url":"https://github.com/naltox/node-vk-sdk","last_synced_at":"2025-10-23T09:31:17.824Z","repository":{"id":60015522,"uuid":"83221893","full_name":"Naltox/node-vk-sdk","owner":"Naltox","description":"Typescript SDK for VK Api","archived":false,"fork":false,"pushed_at":"2020-12-02T16:41:19.000Z","size":502,"stargazers_count":59,"open_issues_count":2,"forks_count":8,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-01-30T17:38:23.069Z","etag":null,"topics":["nodejs","sdk","typescript","vk-api","vkontakte"],"latest_commit_sha":null,"homepage":null,"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/Naltox.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":"2017-02-26T16:06:42.000Z","updated_at":"2024-10-16T08:16:50.000Z","dependencies_parsed_at":"2022-09-25T14:42:38.739Z","dependency_job_id":null,"html_url":"https://github.com/Naltox/node-vk-sdk","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/Naltox%2Fnode-vk-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Naltox%2Fnode-vk-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Naltox%2Fnode-vk-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Naltox%2Fnode-vk-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Naltox","download_url":"https://codeload.github.com/Naltox/node-vk-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237807458,"owners_count":19369595,"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":["nodejs","sdk","typescript","vk-api","vkontakte"],"created_at":"2024-09-26T05:01:37.823Z","updated_at":"2025-10-23T09:31:17.407Z","avatar_url":"https://github.com/Naltox.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-vk-sdk\n\nVK API SDK for Node.js\n\n## Installation\n\nTo install the stable version:\n\n```bash\nnpm install --save node-vk-sdk\n```\n\nThis assumes you are using [npm](https://www.npmjs.com/) as your package manager.\nIf you don’t, you can access these files on [unpkg](https://unpkg.com/node-vk-sdk/), download them, or point your package manager to them.\n\n## Importing\n\nYou can import SDK using ES6 modules:\n\n```typescript\nimport {VKApi, ConsoleLogger} from 'node-vk-sdk'\n```\n\nOr using `require`:\n\n```typescript\nconst {VKApi, ConsoleLogger} = require('node-vk-sdk')\n```\n\n## Usage\n\n```typescript\nimport {VKApi, ConsoleLogger} from 'node-vk-sdk'\n\nlet api = new VKApi({\n    logger: new ConsoleLogger()\n})\n\napi.usersGet({ userIds: ['1'] })\n    .then(response =\u003e {\n        console.log(response)\n    })\n```\n\n## VKApi constructor options\n\n```typescript\ninterface VKApiOptions {\n    lang?: string|number,\n    testMode?: number,\n    logger?: BaseLogger,\n    token?: string,\n    timeout?: number,\n    requestsPerSecond?: number,\n    useQueue?: boolean\n}\n```\n\n* ```lang?```  -  Determines the language for the data to be displayed on. For example country and city names.\nIf you use a non-cyrillic language, cyrillic symbols will be transtiterated automatically  \n`en – English, ru – Russian, ua – Ukrainian, be – Belorussian, es – Spanish, fi – finnish, de – German, it – Italian.`  \nNumeric format from `account.getInfo` is supported as well.\n\n\n* ```test_mode?```  -  1 – allows to send requests from a native app without switching it on for all users.\n\n* ```logger?```  -  Logger class that implements `BaseLogger`\nNo logging will be used logger is not passed\n\n* ```token?```  -  Access token\n\n* ```timeout?```  -  Network timeout in ms\n\n* ```requestsPerSecond```  -  Maximum requests per second, default is 3\n\n* ```useQueue```  -  If useQueue is true, then SDK will limit number of requests per second at `requestsPerSecond`\n\n## Calling methods\n\nAll api methods returning Promise, so you can use them as Promise or as async functions.\nMethods arguments are described in interfaces, so you need to pass object implementing that interface, for example `users.get` props interface:\n\n```typescript\nexport interface UsersGetParams {\n    /**\n     * User IDs or screen names ('screen_name'). By default, current user ID.\n     */\n    user_ids?: string[],\n    /**\n     * Profile fields to return. Sample values: 'nickname', 'screen_name', 'sex', 'bdate' (birthdate), 'city', 'country', 'timezone', 'photo', 'photo_medium', 'photo_big', 'has_mobile', 'contacts', 'education', 'online', 'counters', 'relation', 'last_seen', 'activity', 'can_write_private_message', 'can_see_all_posts', 'can_post', 'universities',\n     */\n    fields?: string[],\n    /**\n     * Case for declension of user name and surname: 'nom' — nominative (default), 'gen' — genitive , 'dat' — dative, 'acc' — accusative , 'ins' — instrumental , 'abl' — prepositional\n     */\n    name_case?: string,\n    /**\n     * access token\n     */\n    access_token?: string\n}\n```\n\nAll props interfaces have `accessToken` property, that token will be used instead of token passed to `VKApi`\n\n\nCalling example:\n\n\n```typescript\napi.usersGet({ user_ids: ['1'] })\n    .then(response =\u003e {\n        console.log(response)\n    })\n\n\n// or we can call it as async function\n\nlet response = await api.usersGet({ user_ids: ['1'] })\n```\n\nDirect call methods:\n\n```typescript\n// makes plain call \u0026 returns contents of \"response\" property of server response\npublic async call(method: string, params: Object): Promise\u003cany\u003e\n\n// Makes api call and if there was\n// server-side error or requests limit was reached\n// repeats the call after some timeout\npublic async callWithRetry(method: string, params: Object): Promise\u003cany\u003e\n```\n\n## Bots Long Poll API\n\nTo receive group updates using Bots Long Poll API use `BotsLongPollUpdatesProvider` class:\n\n```typescript\nimport {VKApi, ConsoleLogger, BotsLongPollUpdatesProvider} from 'node-vk-sdk'\n\nlet api = new VKApi({\n    token: 'GROUP_TOKEN_HERE',\n    logger: new ConsoleLogger()\n})\n\nlet updatesProvider = new BotsLongPollUpdatesProvider(api, GROUP_ID_HERE)\n\nupdatesProvider.getUpdates(updates =\u003e {\n    console.log('got updates: ', updates)\n})\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaltox%2Fnode-vk-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaltox%2Fnode-vk-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaltox%2Fnode-vk-sdk/lists"}