README
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
Usage
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
and use as follows
<script src="index.umd.js"></script>
<script>
// Sends event to client
window.vkConnectPromise
.send('VKWebAppGetEmail')
.then(data => {
// Handling received data
console.log(data.email);
})
.catch(error => {
// Handling an error
});
</script>