For the complete documentation index, see llms.txt. This page is also available as Markdown.

App API (BETA)

Server-verified role detection and admin moderation tools for game owners and editors.


Overview

The App API lets your game detect whether the current player is a member of the development team and, if so, perform admin operations like content moderation.

Roles are server-verified: the backend checks the user's Firebase Auth email against the game's owner and editor list. There is no client-side role assignment to tamper with.

Key Features:

  • Detect whether the current user is an owner, editor, or regular player

  • Browse and remove UGC entries as an admin

  • Browse and remove AI-generated content as an admin: images, video, audio, and 3D models

  • Review and resolve player reports across every content type


Role Detection

Quick Start

import RundotGameAPI from '@series-inc/rundot-game-sdk/api'

const role = await RundotGameAPI.app.getMyRole()

if (role === 'owner' || role === 'editor') {
  showAdminPanel()
} else {
  showPlayerUI()
}

getMyRole()

Returns the current user's role for this game.

Returns: 'owner' | 'editor' | 'none'

Role
Meaning

owner

The user's email matches the game's owner email

editor

The user's email is in the game's editor list

none

No match, anonymous user, or game not found

Security: Roles are resolved server-side from the verified Firebase ID token. Anonymous users and unrecognized emails always receive 'none'.


Engagement

reportEngagement()

Reports an active engagement pulse to the host platform.

Call once per second while a person actively watches or listens; never on a timer that runs without a person.

  • Throttling: Calls are throttled within the SDK to at most once per 1000 ms.

  • Fire-and-forget: Silent (no throw) when no host exists.


Launch Intent

RundotGameAPI.app.resolveLaunchIntent() is the single, supported way to find out how your game was launched — from a share link, a deep link, a notification tap, or a cold/organic start. It replaces the deprecated RundotGameAPI.context.{launchParams,shareParams,notificationParams,shareLinkId} snapshot fields (removed in v6.0.0).

Why a method (and not a field)?

There are two classes of launch intent:

  • Class A — deterministic. An OS universal link, a URI scheme, a notification tap, an already-attached share link, or an in-app launch (the player opened your game from the host's catalog or search, with launch params attached). These are known at (or near) boot, so resolveLaunchIntent() returns them with ~0 wait regardless of maxWaitMs.

  • Class B — deferred. Post-install attribution (deferred deep links). This resolves asynchronously — on iOS it can be postponed up to ~15s by the ATT prompt — so a fresh share install often resolves after INIT_SDK already returned. A one-shot context snapshot is empty in this case; this is exactly the gap resolveLaunchIntent closes.

maxWaitMs is your patience budget: the host returns the intent as soon as the launch route resolves, but waits no longer than your budget. If it hasn't resolved in time you get { kind: 'timed_out' } — which is not terminal. Call again to keep waiting; once the signal settles, every call returns it instantly.

resolveLaunchIntent(options?)

Returns: Promise<LaunchIntent>. The host always resolves a LaunchIntent (it never rejects with a launch-intent value). Like every RPC, the promise can still reject on transport-level failures (a host too old to support the message, or the RPC call timeout) — handle that the same way you handle any other SDK rejection; it is distinct from a timed_out intent.

kind

Meaning

share

Launched from a share link. shareLinkId, sharerId, and the share payload (in params) are populated.

deeplink

Generic deep link (OS initial URL, google-ads af_dp, runtime URL), or an in-app launch — the player opened your game from the host's catalog or search and the host attached launch params. params carries those params. An in-app launch takes precedence over the link the app itself was started from.

notification

Launched by tapping a notification. params carries the notification payload.

none

The host definitively reported no launch link (organic install / resolution completed with no route). Terminal.

timed_out

Your budget elapsed before any answer. Indeterminate and re-callable — call again to keep waiting.

maxWaitMs: 0 means "return what's known now, don't wait." A value above the host ceiling is clamped.


Admin UGC

Available at RundotGameAPI.app.adminUgc. All methods require the caller to be an owner or editor; the server returns 403 Forbidden otherwise.

Browse All Entries

Browse all UGC entries for your game, including non-public entries that the player-facing ugc.browse() hides.

Parameters

Param
Type
Default
Description

contentType

string | string[]

-

Filter by app-defined content type. Pass an array to match any of several types in one query (e.g. ['character', 'level']).

authorId

string

-

Filter by author profile ID

isPublic

boolean

-

Filter by visibility; omit to see all

sortBy

string

'recent'

Sort field: 'recent', 'mostLiked', 'mostUsed'

sortOrder

'asc' | 'desc'

'desc'

Sort direction

limit

number

20

Max entries per page (max 100)

cursor

string

-

Pagination cursor

filters

Record<string, unknown>

-

Custom indexed field filters (fields must have idx_ prefix)

Remove an Entry

Soft-delete any entry regardless of author. The entry's record is marked as status: 'removed' and excluded from all player-facing queries. The content is not permanently deleted; it can be reviewed later.

List Reports

Browse player-submitted reports for UGC content, with optional status filtering.

Parameters

Param
Type
Default
Description

status

'pending' | 'reviewed' | 'dismissed'

-

Filter by report status; omit to see all

cursor

string

-

Pagination cursor from a previous response's nextCursor

limit

number

-

Max reports per page

Resolve a Report

Update a report's status after reviewing it. The action argument accepts only 'reviewed' or 'dismissed' (there is no 'pending' option when resolving).


Admin ImageGen

Available at RundotGameAPI.app.adminImageGen. All methods require the caller to be an owner or editor.

Browse Generated Images

Browse all AI-generated images for your game with optional filtering by creator or status.

Parameters

These are the shared AdminGenBrowseParams: the same shape applies to every admin-gen namespace (adminImageGen, adminVideoGen, adminAudioGen, adminThreeDGen).

Param
Type
Default
Description

profileId

string

-

Filter by creator profile ID

status

'active' | 'removed'

-

Filter by status; omit to see all

sortOrder

'asc' | 'desc'

'desc'

Sort direction (by creation time)

limit

number

20

Max entries per page (max 100)

cursor

string

-

Pagination cursor

Remove a Generated Image

Soft-delete a generated image. The original image is moved to a quarantine area and replaced with a placeholder so existing references don't break with a 404. The record is marked status: 'removed'.

List Reports

Browse player-submitted reports for generated images. Reports paginate with cursor the same way browse() does.

Resolve a Report

The action argument accepts only 'reviewed' or 'dismissed'.


Admin VideoGen

Available at RundotGameAPI.app.adminVideoGen. All methods require the caller to be an owner or editor.

This namespace has the same four methods as Admin ImageGen: browse(params?), removeEntry(generationId), listReports(params?), and resolveReport(reportId, action). browse() returns VideoGenEntry objects.

browse() accepts the shared AdminGenBrowseParams; listReports() accepts status, cursor, and limit.


Admin AudioGen

Available at RundotGameAPI.app.adminAudioGen. All methods require the caller to be an owner or editor. Same four methods as Admin ImageGen; browse() returns AudioGenEntry objects.


Admin ThreeDGen

Available at RundotGameAPI.app.adminThreeDGen. All methods require the caller to be an owner or editor. Same four methods as Admin ImageGen; browse() returns ThreeDGenEntry objects (3D models).

All four generated-content namespaces (adminImageGen, adminVideoGen, adminAudioGen, adminThreeDGen) share the same AdminGenApi shape: identical browse / removeEntry / listReports / resolveReport methods and identical params. Only the entry shape returned by browse() differs per media type (see the Type Reference below).


Building an Admin Panel

Here's a complete example of a simple admin moderation flow:


Type Reference

AppRole

LaunchIntent

AdminUgcEntry

UgcReport

ImageGenEntry

ImageGenReport

VideoGenEntry

Returned by adminVideoGen.browse(). posterUrl and generationCostUsd are optional; provider and mode are free-form strings.

AudioGenEntry

Returned by adminAudioGen.browse(). type is the kind of audio; duration is durationSec. model and voiceId are optional.

ThreeDGenEntry

Returned by adminThreeDGen.browse(). Unlike the other entries, prompt is optional here (a 3D asset can come from an operation other than a text prompt). modelUrl is the required asset URL; rawModelUrl, mode, quality, and estimatedCostUsd are optional.

VideoGenReport, AudioGenReport, ThreeDGenReport

The report shape is the same for every generated-content namespace. VideoGenReport, AudioGenReport, and ThreeDGenReport are each identical to ImageGenReport: generationId points at the offending entry; reason is one of the four enum values; status tracks moderation state.

Last updated