The translation was generated automatically and may contain mistakes

Module: 4. Development

Lesson 5. Working with VK Bridge

The main thing in the lesson

  • VK Bridge is a bridge between a mini application that runs in an iframe or WebView and a VKontakte platform on the user’s device.

  • If you create a project based on шаблона create-vk-mini-app , VK Bridge is already included in your project. If not, you can connect it with the following commands:

    yarn
    yarn add @vkontakte/vk-bridge
    npm
    npm install @vkontakte/vk-bridge
  • Within 30 seconds of running the mini-app, you need to send an initialization message:

    TypeScript
    bridge.send('VKWebAppInit');
  • After initialization, you can call other VK Bridge events. One of them — VKWebAppGetLaunchParams . With it, you get the values of the application startup parameters.

  • Full information about the use of VK Bridge portal for developers .

Useful links

:::