Portex
  • Getting Started
    • Introduction
    • Workflow
    • ShowCase
    • FAQs
  • CLI
    • Overview
    • New Mini-app
    • Check Mini-app
    • Deploy Mini-app
    • Publish Mini-app
    • Bot Manager
      • Bind Telegram Bot
      • Get Bot Info
      • Bot Menu
        • Set Menu Button
      • Bot Message
        • List Messages
        • Save Message
        • Delete Message
  • SDK
    • Overview
    • Friend Referral
    • Payment
    • Webapp Adapter
Powered by GitBook
On this page
  • Features
  • Example
  • API Documentation
  1. SDK

Webapp Adapter

WebApp is a feature that allows you to create a web app that can be used in Telegram WebApp API.

Features

  • get user info from client

  • customize webapp theme

  • support client sensors (like Haptic,Accelerometer, DeviceOrientation, Gyroscope,location)

  • expand or minimize webapp

  • open link in client browser

Example

const portex = new Portex({
    appId: 'your-app-id',
});

await portex.init();


portex.webApp.openLink('https://google.com');
portex.webApp.ready(); //A method that informs the Telegram app that the Mini App is ready to be displayed.
portex.webApp.expand();//A method that expands the Mini App to the maximum available height.
portex.webApp.close();//A method that closes the Mini App.

API Documentation

PreviousPayment

Last updated 21 days ago

https://sdk.portex.app/docs/interfaces/core_types.WebApp.html