This project has been merged into the vk-x monorepo
An alternative library for interacting with vk.com with solid and exceptionally convenient API.
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
After you've included and loaded the script, you can use it either with Promises or with callbacks.
// Authenticate on your website.
vk.authWebsite("app-id", ["permissions"]).then(function() {
vk.users.get()
}).then(function(currentUser) {
// https://vk.com/dev/users.get
})
// Alternatively, obtain the access token yourself.
vk.accessToken = "obtained-access-token"
vk.users.get().then(function(currentUser) {
// https://vk.com/dev/users.get
})
- Basic
vk.method()
support with callbacks - Promises
- Method aliases:
vk.users.get()
instead ofvk.method("users.get")
- Documentation
- Release to npm, Bower, jsDelivr
- Separate builds with and without method aliases
- Auto-retry on 'too many requests' error
- Queue requests to avoid spamming retries
- API error handling (meanwhile, here's a list of error codes)
- Full-fledged server-side support, including
vk.getAuthUrl()
and aliases for secure methods - Better website-type apps support, including automated authentication
- Build size optimization