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

https://github.com/vkcom/vk-connect-promise

A package for integrating VK Mini Apps with official VK clients for iOS, Android and Web with events based on promises
https://github.com/vkcom/vk-connect-promise

Last synced: 8 months ago
JSON representation

A package for integrating VK Mini Apps with official VK clients for iOS, Android and Web with events based on promises

Awesome Lists containing this project

README

          








[![npm][npm]][npm-url]
[![deps][deps]][deps-url]

[npm]: https://img.shields.io/npm/v/@vkontakte/vk-connect-promise.svg
[npm-url]: https://npmjs.com/package/@vkontakte/vk-connect-promise
[deps]: https://img.shields.io/david/vkcom/vk-connect-promise.svg
[deps-url]: https://david-dm.org/vkcom/vk-connect-promise

# VK Connect Promise

A package for integrating VK Mini Apps with official VK clients for iOS, Android and Web with events based on promises.

## ⛔️ DEPRECATED

The package has been deprecated in favor of the `sendPromise` method in [VK Connect](https://github.com/vkcom/vk-connect)

## Usage

```js
import vkConnectPromise from '@vkontakte/vk-connect-promise';

// Sends event to client
vkConnectPromise
.send('VKWebAppGetEmail')
.then(data => {
// Handling received data
console.log(data.email);
})
.catch(error => {
// Handling an error
});
```

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

```html

// Sends event to client
window.vkConnectPromise
.send('VKWebAppGetEmail')
.then(data => {
// Handling received data
console.log(data.email);
})
.catch(error => {
// Handling an error
});

```