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
  • Portex SDK (beta)
  • Install
  • Usage
  • SDK Features
  • API Reference
  • Source
  1. SDK

Overview

Portex SDK is a development kit for creating mini-games on telegram, web and other platforms.

PreviousDelete MessageNextFriend Referral

Last updated 1 month ago

Portex SDK (beta)

Install

  • inline https://sdk.portex.app/portex-sdk.min.js to your mini-game

  • or build from source code

git clone https://github.com/portex-app/portex-sdk.git
cd portex-sdk

pnpm install
pnpm build

Usage

Note: this is a beta version, you can only use it in telegram. get app-id from

  • initialize Portex SDK with your app-id

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

try {
  const result = await portex.init();

  if (result.status === 'ok') {
    // init success
    // get user info
    consle.log(sdk.webApp.initDataUnsafe);
  } else {
    // init failed
  }
} catch (error) {
  console.error(error);
}
  • SDK Demo: https://t.me/portex_app_bot?startapp

SDK Features

  • ads (coming soon)

  • leaderboard (coming soon)

  • game save (coming soon)

API Reference

Source

Portex CLI
Social Invite
Payment
Webapp Adapter
Portex SDK API
https://github.com/portex-app/portex-sdk