@vkontakte/vk-mini-apps-api

VK Mini Apps API

Usage no npm install needed!

<script type="module">
  import vkontakteVkMiniAppsApi from 'https://cdn.skypack.dev/@vkontakte/vk-mini-apps-api';
</script>

README

VK Mini Apps API NPM

Library for quick and efficient development of VK Mini Apps based on 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

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 and use as follows

<script src="index.umd.js"></script>

<script>
  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);
  });
</script>

Full API Reference

At the link above you can find a full API Reference of the library. The API reference was generated by TypeDoc.