Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

usePrivateRoom

usePrivateRoom(): PrivateRoom | null

The private room this page’s room runs, as readPrivateRoom reads it: its owner’s player id. Null in a public room, in a fresh room a public room’s teleport made private to its group, and in a game played alone.

PrivateRoom | null

const privateRoom = usePrivateRoom();
const isOwner = privateRoom?.ownerPlayerId === readPlayerId(localPlayer);