vk-api — JavaScript Driver for vk.com API
An alternative library for interacting with vk.com with solid and exceptionally convenient API.
Install
The driver is packaged as an UMD and is published to:
- NPM:
npm install --save @vk-x/vk-api
- Bower:
bower install vk-api
- jsDelivr CDN:
https://cdn.jsdelivr.net/vk-api/latest/vk-api.min.js
- A smaller version without method shortcuts is also available:
https://cdn.jsdelivr.net/vk-api/latest/vk-api-no-shortcuts.min.js
Use
After you've included and loaded the script, you can use it either with Promises or with callbacks.
vk.authWebsite("app-id", ["permissions"]).then(function() {
vk.users.get()
}).then(function(currentUser) {
})
vk.accessToken = "obtained-access-token"
vk.users.get().then(function(currentUser) {
})
Documentation
Roadmap
License — MIT