import { HelixInteractionPrompt, HelixNotification, HelixDeviceState, HelixWorldContext, HelixUser, DebugLogEntry, Balance, PurchaseResult, PurchaseContext, PurchaseOptions, Entitlements, ConsumeResult, InventoryItem, EquippedAvatar, EquippedEmotes, EquippedLocomotionPack, AvatarLoadout, AvatarLoadoutPatch, HelixPresenceActivity, DataStoreListPage, LeaderboardPage, LeaderboardSubmitResult, LeaderboardSubmitOptions, LeaderboardTopOptions, DataStoreWriteOptions, DataStoreListOptions, AchievementListResult, AchievementMineResult, MarketplaceListing, MarketplaceQuery, CameraAspect, SavedPhoto, HelixCameraCapability, HelixCameraControl, HelixCameraDroneCommand, HelixCameraDroneState, HelixCameraState, RuntimeFidelityIntent, PackageCustomizerSubject, PackageCustomizerSource, PackageCustomizerContext, DeviceTrialSpawn } from './protocol.js'; import { HelixMultiplayer } from './multiplayer.js'; import { HelixVoice } from './voice.js'; import { HelixMatchmaking, HelixParty } from './matchmaking.js'; import { CaptureOptions } from './camera.js'; import type { WorldSpawn } from './universal-vehicles.js'; export { WorldDeviceHost, deviceRuntimeModuleId as worldDeviceRuntimeModuleId, } from './devices.js'; export type { DeviceDefinitionReference, DeviceBusBudgetsV1, DeviceAppDefinitionV1, DeviceAppPermissionV1, DeviceAppTypeV1, DeviceBusEnvelopeV1, DeviceDefinitionV1, DevicePortAddressV1, DevicePortAuthorityV1, DevicePortDataTypeV1, DevicePortDirectionV1, DevicePortKindV1, DevicePortV1, DeviceStreamHandleV1, DeviceStreamRoutabilityV1, WorldDeviceDefinitionResolver, WorldDevicePresentation, WorldDevicePresentationAdapter, } from './devices.js'; export { createSealedDeviceDefinitionResolver, normalizeSealedDeviceDefinitionProjection, } from './device-definition-resolver.js'; export type { SealedDeviceDefinitionPin, SealedDeviceDefinitionProjection, SealedDeviceDefinitionResolver, SealedDeviceDefinitionResolverOptions, } from './device-definition-resolver.js'; export type { HelixInteractionPrompt, HelixNotification, HelixNotificationKind, HelixPromptState, HelixDeviceFormFactor, HelixDeviceState, HelixWorldContext, HelixSession, HelixUser, DebugLogEntry, DebugLogLevel, Balance, PurchaseResult, PurchaseStatus, PurchaseContext, PurchaseOptions, ItemEditionMode, AccountVerificationLevel, ProductGrant, Entitlements, ConsumeResult, InventoryItem, EquippedAvatar, AvatarComposition, EquippedEmote, EquippedEmotes, EquippedLocomotionPack, AvatarLoadout, AvatarLoadoutPatch, HelixPresenceActivity, HelixMultiplayerState, HelixMultiplayerRosterEntry, HelixVoiceState, HelixVoiceSettings, HelixVoiceMicMode, HelixVoicePermission, HelixVoiceDevice, DataStoreListPage, DataStoreListPayload, LeaderboardEntry, LeaderboardOrder, LeaderboardPage, LeaderboardSubmitResult, LeaderboardSubmitOptions, LeaderboardTopOptions, DataStoreWriteOptions, DataStoreListOptions, AchievementSummary, AchievementListResult, AchievementMineResult, MarketplaceListing, MarketplaceQuery, CameraAspect, SavedPhoto, CameraSessionState, CameraMediaMode, CameraSpatialMode, CameraControlTarget, CameraLensPreset, CameraFilterId, CameraTimerSeconds, CameraAim, CameraFocusPoint, CameraVector3, CameraDroneLockMode, HelixCameraCapability, HelixCameraShutter, HelixCameraState, HelixCameraControl, HelixCameraDroneTransform, HelixCameraDroneState, HelixCameraDroneCommand, RuntimeFidelityIntent, RuntimeFidelityVisualTier, RuntimeFidelityRenderScale, RuntimeProfileQuality, PackageCustomizerSubject, PackageCustomizerSource, PackageCustomizerContext, DeviceTrialSpawn, } from './protocol.js'; export { normalizeDeviceTrialSpawn } from './device-trial.js'; export { CAMERA_LENS_PRESETS, RUNTIME_FIDELITY_VERSION, RUNTIME_FIDELITY_VISUAL_TIERS, RUNTIME_FIDELITY_RENDER_SCALES, RUNTIME_PROFILE_QUALITIES, normalizeRuntimeFidelityIntent, XR_INTERACTION_PROMPT_EVENT, XR_SESSION_EVENT, } from './protocol.js'; export type { CaptureOptions, CropRect, CameraCapabilityFlag } from './camera.js'; export { cropRectForAspect, captureCanvas, CAMERA_MIN_ZOOM, CAMERA_MAX_ZOOM, clampCameraZoom, nearestLensPreset, defaultCameraCapability, defaultCameraState, cloneCameraState, cloneCameraCapability, intersectCameraCapability, CAMERA_CAPABILITY_FLAGS, normalizeCameraCapability, normalizeCameraState, validateCameraControl, cameraCapabilityGate, isCameraSessionState, isCameraMediaMode, isCameraSpatialMode, isCameraControlTarget, isCameraFilterId, isCameraTimerSeconds, isCameraDroneLockMode, } from './camera.js'; export { createMaterialLibrary, createMaterialsNamespace, DEFAULT_MATERIAL_PACK_SLUG, } from './materials.js'; export type { HelixMaterialCatalog, HelixMaterialDefinition, HelixMaterialKind, HelixMaterialLibrary, HelixMaterialMapPaths, HelixMaterialQuery, HelixMaterialResolutionOption, HelixMaterialResolutionTier, HelixMaterialResolutionVariant, ResolvedHelixMaterial, } from './materials.js'; export type { HelixRoom, JoinRoomOptions, ReplicaInput } from './multiplayer.js'; export type { SwitchRoomTarget, SwitchRoomOptions, RoomTicket, HelixRoomJoinErrorCode, HelixRoomLeaveReason } from './multiplayer.js'; export { HelixRoomJoinError } from './multiplayer.js'; export { HelixMatchmakingError, HelixPartyError } from './matchmaking.js'; export type { QueueStatus, QueueWaiting, QueueEndReason, MatchFound, Party, PartyMember, PartyCode, PartyInvite, PartyState, PartyInviteReceipt, HelixMatchmakingErrorCode, HelixPartyErrorCode, } from './matchmaking.js'; export type { VehiclePackageArtifact, WorldSpawn, ModuleIdentity, ModuleActionRequest, VehicleComponentActionRequest, VehicleDetachActionDescriptor, VehicleDetachActions, VehicleDetachActionRequest, VehicleRole, ModuleStateSnapshot, ModuleEffect, } from './universal-vehicles.js'; export type { JoinVoiceOptions, HelixVoiceVec3, HelixVoiceAudioFeatures } from './voice.js'; export { DEFAULT_PUSH_TO_TALK_KEY } from './voice.js'; export { createVarsView, createRoomAccessors, createModuleAccessors } from './multiplayer-accessors.js'; export type { VarsView, RoomAccessors, ModuleAccessors, AccessorRoomState, AccessorModuleState } from './multiplayer-accessors.js'; export { createVaultClient, createVaultLoadPlan, VAULT_ASSET_KINDS, VaultApiError, VaultArtifactUnavailableError, VaultCapabilityUnavailableError, VaultChecksumMismatchError, VaultUnsupportedRuntimeError, } from './vault.js'; export type { VaultAnimationMetadata, VaultArtifactMetadata, VaultArtifactReference, VaultAssetDetail, VaultAssetHandle, VaultAssetKind, VaultAssetSummary, VaultAssetVersion, VaultAudioGenerationMode, VaultAudioMetadata, VaultCanonicalThumbnail, VaultCharacterMetadata, VaultClient, VaultClientOptions, VaultCompatibility, VaultDecalMetadata, VaultDownloadedArtifact, VaultEnvironmentMetadata, VaultGaussianSplatMetadata, VaultInstallOptions, VaultInstallResult, VaultImmutableArtifactReference, VaultLoadPlan, VaultMaterialMetadata, VaultMetadataByKind, VaultPerformanceMetadata, VaultPerformanceTier, VaultPropMetadata, VaultRankMode, VaultRelatedArtifact, VaultResolvedArtifact, VaultResolvedAsset, VaultRuntime, VaultSceneMetadata, VaultSearchQuery, VaultSearchResult, VaultSelectionExplanation, VaultSkyMetadata, VaultSplatScope, VaultTerrainMetadata, VaultTextureMetadata, VaultUnrealPackageMetadata, VaultVfxMetadata, } from './vault.js'; export { createDreamerAudioClient, DREAMER_AUDIO_TIMEOUT_MS, DreamerAudioApiError, DreamerAudioCapabilityUnavailableError, DreamerAudioJobFailedError, DreamerAudioJobTimeoutError, DreamerAudioVaultUnavailableError, } from './dreamerAudio.js'; export { ANY_VERB, ModeStack, bindStackSafety, normaliseTouch, validateInputMap, } from './interaction-mode.js'; export type { CameraIntent, Capability, InputLeaseHandle, InputLeaseRequest, InputMap, InteractionMode, ModeCapability, ModeContext, ModeEndReason, ModeHost, ModePhase, ModeResult, PushOptions, PushOutcome, StandardModeAction, Suppression, TouchPresentation, TouchPresentationKind, TouchPresentationZone, TouchBinding, TouchKind, VerbBinding, VerbEvent, VerbHandler, VerbPhase, VerbSink, } from './interaction-mode.js'; export { UniversalActionSurface, createActionSurfaceInputMap, createActionSurfaceMode, validateActionSurfaceSnapshot, } from './action-surface.js'; export type { ActionSurfaceAction, ActionSurfaceAvailability, ActionSurfaceDevice, ActionSurfaceHintSource, ActionSurfaceInvocation, ActionSurfaceKind, ActionSurfaceModeOptions, ActionSurfaceOption, ActionSurfaceOptionsFrom, ActionSurfaceSnapshot, UniversalActionSurfaceOptions, } from './action-surface.js'; export type { DreamerAudioArtifact, DreamerAudioClient, DreamerAudioClientOptions, DreamerAudioGenerateRequest, DreamerAudioGenerationMode, DreamerAudioJob, DreamerAudioPendingJob, DreamerAudioPollOptions, DreamerAudioSucceededJob, DreamerAudioFailedJob, DreamerAudioVoiceSettings, DreamerGeneratedVaultAudio, DreamerMusicRequest, DreamerSoundEffectRequest, DreamerTextToSpeechRequest, } from './dreamerAudio.js'; export * from './multiplayer-contract/index.js'; export * from './vehicle-specialty-transport.js'; export * from './vehicle-specialty-placement.js'; /** * A shell-mediated request that failed. `code` classifies it when the shell could — * `'version-conflict'` (an optimistic-concurrency clash), `'rate-limited'`, or a Data Store * key-policy rule such as `'session-sub-key'` — so a world branches on the code instead of * matching error prose. Undefined when the shell is older than the code it would have sent, * or the failure has no classification. */ export declare class HelixRequestError extends Error { readonly code?: string; constructor(message: string, code?: string); } export type HelixInitResult = { embedded: boolean; world: HelixWorldContext | null; user: HelixUser | null; /** * Validated presentation intent frozen by the shell for this World load. * Null means an older shell or invalid payload; resolve through engine Auto. */ runtimeFidelity: RuntimeFidelityIntent | null; /** Validated, immutable local package configuration sealed into this trial session. */ customizerSubject: PackageCustomizerSubject | null; /** Trial provenance retained when its subject expires or fails validation. */ customizerSource: PackageCustomizerSource | null; }; type AuthListener = (user: HelixUser | null) => void; type AnalyticsEventName = 'world_entered' | 'world_loaded' | 'world_load_failed' | 'world_exited' | 'world_heartbeat' | 'instance_joined' | 'instance_left' | 'creator_product_viewed' | 'client_error_seen' | 'api_error_seen'; type AnalyticsTrackInput = { eventId?: string; instanceId?: string | null; itemId?: string | null; inviteId?: string | null; referrer?: string | null; properties?: Record; }; /** * Result of a listen host admitting one joiner's single-use join token. The player-owned host * (profile `listen`) presents the joiner's token + a per-peer connection id; the shell holds the * host capability and account JWT and performs the backend consume, returning this correlated result. * The host admits the peer's connection ONLY when `admitted` is true. * * Identity, not seat, is what admission certifies: on `admitted: true` the backend has verified the * token and its ListenSeatRecord names the REAL HELIX user behind the join — returned here as * `joinerUserId`. That field is REQUIRED when `admitted` is true, and a consuming runtime that * receives an admitted receipt without it must FAIL CLOSED: treat the connection as unadmitted and * never substitute an assumed identity (a seat id is not a user id). Refused receipts keep their * shape — `admitted: false` + `reason?`, never a seatId or joinerUserId. */ export type ListenAdmissionResult = { admitted: boolean; seatId?: string; joinerUserId?: string; reason?: string; }; /** Result of a listen host session heartbeat (session-level; the shell holds the capability). */ export type ListenHeartbeatResult = { status: 'open' | 'closed'; expiresAt: string; }; /** Result of a listen host closing its session (host departure closes the world; no migration). */ export type ListenCloseResult = { closed: boolean; releasedSeatIds: string[]; }; /** * Result of a listen host reporting one admitted joiner's departure so the backend frees the seat. * The shell authenticates the owning host and addresses the canonical disconnect route; `released` * is the backend's verdict for THIS (seatId, connectionId) pair — false when the pair did not match * an admission still standing (already departed, wrong connection, or session gone). Not an error: * a departed peer is departed, and the host drops the peer either way. */ export type ListenReleaseResult = { released: boolean; }; declare class HelixSdk { private shellOrigin; private session; private worldContext; private runtimeFidelityIntent; private customizerSubject; private customizerSource; private deviceTrialSpawn; private requestedInstanceId; private initialized; private listeners; private debugEnabled; private debugRing; private debugListeners; private consoleHooked; private pendingLogins; private pendingRequests; private balanceListeners; private inventoryListeners; private entitlementListeners; private avatarListeners; private emoteListeners; private deviceState; private deviceListeners; private deviceGlobalShortcutEnabled; private cameraState; private cameraRuntimeCapability; private cameraShellCapability; private cameraListeners; private autoPurchaseAttempts; private left; private leaveListeners; /** Code-free default material packs resolved from their platform CDN base. */ readonly materials: { load(assetBaseUrl: string): Promise; fromCatalog(assetBaseUrl: string, catalog: import("./materials.js").HelixMaterialCatalog): import("./materials.js").HelixMaterialLibrary; clearCache(): void; }; /** Authoritative owned item instances currently standing in this World. */ readonly world: { getSpawns: () => Promise; }; init(): Promise; private readonly serverClock; readonly multiplayer: HelixMultiplayer; readonly voice: HelixVoice; private readonly socialHost; readonly party: HelixParty; readonly matchmaking: HelixMatchmaking; readonly debug: { enabled: () => boolean; log: (...args: unknown[]) => void; onLog: (cb: (entry: DebugLogEntry) => void) => (() => void); recent: () => DebugLogEntry[]; }; /** Live, read-only access to the current trial customizer projection. */ readonly customizer: { getContext: () => PackageCustomizerContext; }; /** Live, read-only access to the authenticated session's ephemeral Device trial. */ readonly trial: { getDeviceSpawn: () => DeviceTrialSpawn | null; }; readonly auth: { getUser: () => Promise; isAuthenticated: () => boolean; requestLogin: () => Promise; onAuthChanged: (listener: AuthListener) => (() => void); }; readonly notify: { show: (notification: HelixNotification) => boolean; success: (title: string, message?: string) => boolean; failure: (title: string, message?: string) => boolean; notification: (title: string, message?: string) => boolean; message: (title: string, message?: string) => boolean; }; readonly prompts: { set: (prompt: HelixInteractionPrompt) => boolean; clear: (promptId?: string) => boolean; }; readonly device: { openTablet: () => boolean; openPhone: () => boolean; /** * Enable or disable the SDK-owned Tab shortcut. Enabled by default. * An earlier key handler may override one event with `preventDefault()`; a World-level * window handler registered after `Helix.init()` should disable this shortcut instead. */ setGlobalShortcutEnabled: (enabled: boolean) => void; getState: () => HelixDeviceState; onStateChanged: (cb: (state: HelixDeviceState) => void) => (() => void); }; getSessionToken(): string | null; /** * True once the player has left this world: the shell's Exit button, the browser's Back off the play page, * and, for some worlds, the play page being unloaded (all reach the SDK as helix:leave). From then on the SDK leaves the * room and voice, matchmaking and parties stop, and `Helix.multiplayer.joinRoom()` / `switchRoom()` reject * with code `left` — whether or not the world held a room when the leave came. A world that runs its own * room lifecycle (bot matches, its own rejoin retries) checks this before it rejoins. * * It stays true for the rest of this world document. The shell never re-enters a world in the same * document: entering again is a new iframe document, so a new SDK instance and a new helix:init, which * starts at false. The one way the same document comes back is a back/forward-cache restore of the play * page (the page is shown again without a new handshake); then this is false again and rooms can be joined. * * Only the shell that initialised this world can end it: a helix:leave that arrives before helix:init (or * from another origin) does not count. */ hasLeft(): boolean; /** * Called once, synchronously, when the player leaves this world (see hasLeft(), which is already true by * then). A subscriber registered after the leave is not called; read hasLeft() instead. Returns an * unsubscribe function. A throwing subscriber is logged and does not stop the others. The subscribers are * taken as a snapshot when the leave arrives: unsubscribing another one from inside a callback does not * stop it being called for this leave. */ onLeave(cb: () => void): () => void; readonly wallet: { getBalance: () => Promise; onBalanceChanged: (cb: (b: Balance) => void) => (() => void); }; readonly listen: { consume: (sessionId: string, listenJoinToken: string, connectionId: string) => Promise; release: (sessionId: string, seatId: string, connectionId: string) => Promise; heartbeat: (sessionId: string) => Promise; close: (sessionId: string) => Promise; }; readonly marketplace: { purchaseProduct: (productKey: string, options?: PurchaseOptions | number) => Promise; purchaseDistributionKey: (key: string, options?: PurchaseOptions | number) => Promise; purchaseDistribution: (distributionId: string, options?: PurchaseOptions | number) => Promise; purchaseListing: (listingId: string, options?: PurchaseOptions) => Promise; getPurchase: (idempotencyKey: string, ref?: string) => Promise; getListings: (query?: MarketplaceQuery) => Promise; getPurchaseContext: (ref: string, options?: PurchaseOptions | number) => Promise; }; readonly purchases: { getEntitlements: () => Promise; consume: (code: string, amount: number) => Promise; getPurchase: (idempotencyKey: string, ref?: string) => Promise; onEntitlementsChanged: (cb: () => void) => (() => void); }; readonly analytics: { track: (eventName: AnalyticsEventName, input?: AnalyticsTrackInput) => Promise; }; readonly inventory: { hasItem: (itemId: string) => Promise; getQuantity: (itemId: string) => Promise; getMyItems: () => Promise; equipItem: (itemId: string) => Promise; onInventoryChanged: (cb: () => void) => (() => void); }; readonly dataStore: { get: (key: string) => Promise; getEntry: (key: string) => Promise<{ value: T; version: number; } | null>; set: (key: string, value: T, options?: DataStoreWriteOptions) => Promise; delete: (key: string, options?: DataStoreWriteOptions) => Promise; list: (prefix?: string, opts?: DataStoreListOptions) => Promise; }; readonly leaderboard: { submit: (board: string, score: number, options?: LeaderboardSubmitOptions) => Promise; top: (board: string, options?: LeaderboardTopOptions) => Promise; }; readonly achievements: { list: () => Promise; mine: () => Promise; }; readonly camera: { available: () => boolean; capture: (canvas: HTMLCanvasElement, opts?: CaptureOptions) => Promise; savePhoto: (image: Blob | ArrayBuffer | Uint8Array, meta?: { caption?: string; aspect?: CameraAspect; contentType?: string; }) => Promise; getState: () => HelixCameraState; onStateChanged: (cb: (state: HelixCameraState) => void) => (() => void); capabilities: () => HelixCameraCapability; reportCapability: (capability: HelixCameraCapability) => boolean; control: (control: HelixCameraControl) => Promise; flyDrone: (command: HelixCameraDroneCommand) => Promise; }; readonly avatar: { openCreator: () => Promise; getLoadout: () => Promise; updateLoadout: (patch: AvatarLoadoutPatch) => Promise; getEquipped: () => Promise; /** Resolve another joined player's public configured avatar for replica rendering. */ getEquippedForUser: (userId: string) => Promise; onAvatarChanged: (cb: () => void) => (() => void); }; readonly emotes: { getEquipped: () => Promise; /** * Fires after the shell has settled and closed an emote-customizer session. A joined room uses the * same cue to re-resolve its authoritative seat; a join:false world re-fetches getEquipped instead. */ onChanged: (cb: () => void) => (() => void); /** * Raise the platform's emote-wheel customizer over this world. * * Routed through the `helix:request` bridge, unlike `getEquipped()` above, which deliberately * calls the public platform API directly. The difference is that this one CHANGES something and * needs the player's own credential: the shell owns the session, so the shell owns the editor. * A world can ask for the door to be opened and learns only whether it was. * * Resolves `false` when the player is signed out (the shell routes them to auth instead) or when * the host has no customizer mounted — never throws for either, because "the editor did not open" * is a normal outcome a world should handle, not an exception. */ openCustomizer: () => Promise; }; readonly locomotion: { /** * The locomotion pack the local player MOVES on — read off the seat, not an endpoint. * * Deliberately unlike `avatar.getEquipped` / `emotes.getEquipped`, which resolve through the shell * bridge or a public platform endpoint: a locomotion pack is resolved SERVER-SIDE by the ROOM at join * (and re-resolved on the `avatarRefresh` hint) and written onto PlayerState.locomotionPack — contract * v34 — so the replicated seat is the only place a client can honestly learn which pack landed on it. * Asking the platform directly would answer "what is equipped", which is not the same question as * "what is this seat playing". * * Returns null when there is no seat to read (no room joined, or this session's player has not * replicated yet) — the same "could not resolve at all" null its siblings return. An EMPTY `pack` is a * real answer: the seat moves on the platform locomotion set, which is equally what a room predating * v34, an unresolvable pack and an unservable URL replicate. Never throws. */ getEquipped: () => Promise; }; readonly presence: { setActivity: (activity: HelixPresenceActivity) => Promise; clearActivity: () => Promise; }; private purchase; private purchaseQuantity; private purchaseAttemptSlot; private readPersistedPurchaseAttempts; private writePersistedPurchaseAttempts; private autoPurchaseKey; private clearAutoPurchaseAttempt; private settlePurchaseResult; private trackAnalytics; private safeAnalyticsProperties; private openDevice; private onKeyDown; private isInteractiveUiEvent; private request; private newId; private fetchAvatarLoadout; private fetchEquippedAvatar; private emitAvatarChanged; private snapshot; private assertInitialized; private waitForInit; private onMessage; private markLeft; private onPageRestored; private emitLeave; private setDeviceState; private setCameraState; private effectiveCameraCapability; private cameraCapabilityRefusal; private adoptShellCameraState; private setSession; private currentCustomizerContext; private enableDebug; private hookConsole; private notePreview; private captureLog; private post; private postToShell; private xrSessionBridgeAttached; private attachXrSessionBridge; private onXrSession; } export declare const Helix: HelixSdk;