# @vk-x/vk-api

> JavaScript Driver for vk.com API

Latest version **0.5.3** (published 2017-12-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @vk-x/vk-api
pnpm add @vk-x/vk-api
yarn add @vk-x/vk-api
bun add @vk-x/vk-api
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.3 |
| Published | 2017-12-14 |
| First published | 2016-04-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Nikita Litvin |
| Maintainers | deltaidea |
| Keywords | vk, vk.com, api, vk-api, vk-x |

## Links

- npm: https://www.npmjs.com/package/@vk-x/vk-api
- Repository: https://github.com/vk-x/vk-x
- Homepage: https://github.com/vk-x/vk-x/tree/master/packages/vk-api#readme
- Issues: https://github.com/vk-x/vk-x/issues
- npm.io page: https://npm.io/package/@vk-x/vk-api

## Recent versions

- 0.5.3 (latest) — 2017-12-14
- 0.5.2 — 2017-05-10
- 0.5.1 — 2017-05-10
- 0.5.0 — 2016-08-27
- 0.4.0 — 2016-05-05
- 0.3.2 — 2016-05-03
- 0.3.1 — 2016-05-02
- 0.3.0 — 2016-04-27
- 0.2.0 — 2016-04-27
- 0.1.1 — 2016-04-18
- 0.1.0 — 2016-04-18

## README

# 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](https://github.com/umdjs/umd) and is published to:

- [NPM](https://www.npmjs.com/package/@vk-x/vk-api): `npm install --save @vk-x/vk-api`
- [Bower](http://bower.io/search/?q=vk-api): `bower install vk-api`
- [jsDelivr CDN](http://www.jsdelivr.com/projects/vk-api): `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.

```JavaScript

// 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
})

```

## Documentation

- [Driver API](docs/api.md)
- [API Documentation (vk.com)](https://vk.com/dev/methods)


## Roadmap

- [x] Basic `vk.method()` support with callbacks
- [x] Promises
- [x] Method aliases: `vk.users.get()` instead of `vk.method("users.get")`
- [x] Documentation
- [x] Release to npm, Bower, jsDelivr
- [x] Separate builds with and without method aliases
- [x] Auto-retry on 'too many requests' error
- [ ] Queue requests to avoid spamming retries
- [ ] API error handling (meanwhile, here's [a list of error codes](https://vk.com/dev/errors))
- [ ] Full-fledged server-side support, including `vk.getAuthUrl()` and aliases for secure methods
- [ ] Better website-type apps support, including automated authentication
- [ ] Build size optimization


## License — [MIT](LICENSE.md)

---
_Source: https://npm.io/package/@vk-x/vk-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
