An open API service indexing awesome lists of open source software.

https://github.com/vkcom/vk-mini-apps-api

The official package for quick and easy development of VK Mini Apps
https://github.com/vkcom/vk-mini-apps-api

Last synced: 8 months ago
JSON representation

The official package for quick and easy development of VK Mini Apps

Awesome Lists containing this project

README

          

[npm-badge]: https://img.shields.io/npm/v/@vkontakte/vk-mini-apps-api.svg
[npm-link]: https://npmjs.com/package/@vkontakte/vk-mini-apps-api

[](https://vk.com/services)

# VK Mini Apps API [![NPM][npm-badge]][npm-link]

Library for quick and efficient development of VK Mini Apps based on [VK Bridge](https://github.com/vkcom/vk-bridge) methods.

Unlike VK Bridge, VK Mini Apps API already contains all the ready-made Javascript-functionality for interacting with the official clients.

## Usage

Install the library via yarn

```
$ yarn add @vkontakte/vk-mini-apps-api
```

or npm

```
$ npm install @vkontakte/vk-mini-apps-api
```

Use in your code in the following way

```javascript
import { VKMiniAppAPI } from '@vkontakte/vk-mini-apps-api';

// Creating API instance
const api = new VKMiniAppAPI();

// Initializing app
api.initApp();

// Using methods
api.getUserInfo().then(userInfo => {
console.log(userInfo.id);
});
```

For use in a browser, include the file [dist/index.umd.js](http://unpkg.com/@vkontakte/vk-mini-apps-api/dist/index.umd.js) and use as follows

```html

const { VKMiniAppAPI } = window.vkMiniAppsAPI;

// Creating API instance
const api = new VKMiniAppAPI();

// Initializing app
api.initApp();

// Using methods
api.getUserInfo().then(userInfo => {
console.log(userInfo.id);
});

```

## [Full API Reference](./docs/classes/vkminiappapi.md)

At the link above you can find a full API Reference of the library. The API reference was generated by [TypeDoc](https://github.com/TypeStrong/typedoc).