@tpgames/core-types
v0.5.0
Published
Shared manifest, lifecycle, settings, surface, and analytics contract types for TPG games.
Readme
@tpgames/core-types
Shared manifest, lifecycle, settings, surface, and analytics contract types for TPG games.
Install
bun add @tpgames/core-typesUse this package when you need the low-level room, lifecycle, manifest, or versioned analytics types without the full authoring SDK.
The package root remains the supported public import path. Internally, the contracts are organized by analytics, bridge payloads, discovery, manifests, payouts, runtime, and opaque identifiers; the root re-exports the complete compatibility surface.
Use decodeRuntimeBridgePayload at shell/runtime trust boundaries. It validates
supported runtime and shell payloads and returns structured issue codes and
paths without copying rejected payload contents into diagnostics.
The platform analytics contract exports:
PLATFORM_ANALYTICS_SCHEMA_VERSIONPLATFORM_ANALYTICS_EVENT_TYPESPLATFORM_ANALYTICS_STANDARD_DIMENSIONSPLATFORM_ANALYTICS_DIMENSION_VALUESCREATOR_ANALYTICS_METRIC_DEFINITIONSCREATOR_PAYOUT_METRIC_MODEL_VERSIONCREATOR_PAYOUT_SESSION_QUALIFICATION_RULESCREATOR_PAYOUT_METRIC_DEFINITIONSCREATOR_PAYOUT_TRAFFIC_CLASSESCREATOR_PAYOUT_INSTRUMENTATION_GAPSPlatformAnalyticsEventGameAnalyticsSummary
The game metadata taxonomy exports:
GAME_CATEGORY_VALUESGAME_INTERACTION_MODE_VALUESGAME_SESSION_PACE_VALUESGameMetadatagetGameMetadataAnalyticsDimensions
The manifest topology contract also exports the canonical:
SessionTopologySessionDisplayRequirementPlayableParticipantMode
The portable TV renderer contract exports:
PORTABLE_DISPLAY_PRIMITIVE_VALUESPortableDisplayPrimitivePortableDisplayRendererRequirement
Games that emit the bounded native renderer format declare portableDisplay
in their manifest with renderer tpg.portable-display, version 1, and every
primitive required for correct play.
The manifest browser-policy contract exports:
GAME_PERMISSION_VALUESPLATFORM_CAPABILITY_VALUESPermissionPlatformCapability
Reserved tpg:* declarations are platform features. The published
Game Capability Matrix
defines which values expand an approved game iframe's sandbox or Permissions
Policy. Recognized non-tpg:* capabilities remain game metadata and never
grant browser access; unknown capability strings fail strict manifest
validation.
