Skip to content

API Reference

All available gametegra methods, organised by category.

App / SuperApp

MethodDescription
gametegra.getInfoRetrieves the current user's profile information.
gametegra.getLanguageReturns the app language and the device's system language.
gametegra.getLocationGets the device's current GPS location.
gametegra.cameraOpens the device camera and returns a base64-encoded JPEG image.
gametegra.getImageOpens the device photo gallery for image selection.
gametegra.payInitiates a payment transaction for the given amount.
gametegra.getParamsRetrieves a launch parameter passed to the miniapp by key.
gametegra.openMiniAppOpens another miniapp by its ID and returns the new session ID.
gametegra.searchMiniappsSearches available miniapps by a text query.
gametegra.reportEventReports a custom analytics event with arbitrary data.
gametegra.reportMiniAppSubmits a report or feedback about a user or the miniapp itself.
gametegra.callMethodCalls a custom method exposed by the host app by name.
gametegra.startStreamStarts listening to a named event stream. Returns an Emitter to subscribe/unsubscribe.

Lifecycle & UI

MethodDescription
gametegra.showLoadingDisplays the host app's loading spinner.
gametegra.hideLoadingHides the host app's loading spinner.
gametegra.vibrateTriggers a haptic vibration on the device.
gametegra.getSafeAreaInsetsReturns the device's safe area insets (notch, home bar, etc.).
gametegra.closeCompletely closes and unmounts the miniapp.
gametegra.sendToBackgroundMinimizes the miniapp and sends it to the background without closing it.
gametegra.showMenuDisplays the miniapp's native menu overlay.
gametegra.setOrientationSets the screen orientation mode.
gametegra.onBackgroundRegisters a callback that fires when the miniapp is sent to the background.
gametegra.onForegroundRegisters a callback that fires when the miniapp returns to the foreground.

Game / SuperGame

MethodDescription
gametegra.createRoomCreates a new multiplayer game room.
gametegra.joinRoomJoins an existing game room by match ID.
gametegra.leaveRoomLeaves the current game room.
gametegra.quickMatchInitiates automatic matchmaking.
gametegra.getScoreRetrieves the current player's score.
gametegra.saveDataSaves a key-value pair to the player's persistent game storage.
gametegra.loadDataLoads stored data entries for the current player.
gametegra.showAdDisplays an advertisement.
gametegra.createLeaderboardCreates a new leaderboard configuration.
gametegra.updateLeaderboardSubmits or updates the current player's score on a leaderboard.
gametegra.getLeaderboardFetches the top scores from a leaderboard.
gametegra.openMatchChatOpens the native match chat UI.
gametegra.customCalls a custom backend game function by name.
gametegra.callGameMethodCalls a game method by its key or mapped name. Useful when method names are overridden via setMethodMap.
gametegra.setMethodMapOverrides the default backend method names with custom names.

Stream / Real-time

MethodDescription
gametegra.sendDataSends data over the active game stream.
gametegra.listenDataStarts listening to incoming game stream data. Returns an Emitter.
gametegra.connectGameConnects to a named game stream and returns an Emitter for real-time events.
gametegra.stopStreamStops an active stream by its channel key.
gametegra.getGyroscopeStarts streaming gyroscope sensor data from the device.
gametegra.getAccelerometerStarts streaming accelerometer sensor data from the device.

Chat

MethodDescription
gametegra.roomChat.joinJoins or creates a named room chat channel. Returns a handle for sending/receiving messages.
gametegra.roomChat.sendSends a message to the chat room. Called on the handle returned by roomChat.join().
gametegra.roomChat.getHistoryRetrieves past messages from the chat room. Called on the handle returned by roomChat.join().
gametegra.roomChat.onRegisters an event listener on the chat handle. Supported events: message, presence, error, end. Called on the handle returned by roomChat.join().
gametegra.roomChat.leaveLeaves the chat room and cleans up all event listeners. Called on the handle returned by roomChat.join().

Controls (JS/Web only)

MethodDescription
gametegra.controls.showRenders the virtual gamepad overlay on screen.
gametegra.controls.hideHides the virtual gamepad overlay without destroying it.
gametegra.controls.onRegisters a listener for a specific control input event.
gametegra.controls.onAnyRegisters a listener for all control input events.
gametegra.controls.destroyCompletely destroys the controls — removes DOM elements, CSS, and all event listeners.

Dev Console (JS/Web only)

MethodDescription
gametegra.devConsole.showShows the developer console overlay. Optionally intercepts native console output.
gametegra.devConsole.logPrints a message to the dev console overlay.
gametegra.devConsole.hideHides the console panel. The toggle button remains visible so the panel can be reopened.
gametegra.devConsole.toggleToggles panel visibility — hides if open, shows if hidden.
gametegra.devConsole.warnAdds a warning-level log entry to the dev console panel.
gametegra.devConsole.errorAdds an error-level log entry to the dev console panel.
gametegra.devConsole.successAdds a success-level log entry to the dev console panel.
gametegra.devConsole.clearClears all log entries from the dev console panel.