@vkontakte/vk-mini-apps-api
TypeScript icon, indicating that this package has built-in type declarations

0.6.5 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @vkontakte/vk-mini-apps-api

Weekly Downloads

6

Version

0.6.5

License

MIT

Unpacked Size

292 kB

Total Files

16

Last publish

Collaborators

  • vkcom-publisher
  • terdenan