Ansekai DocsAnsekai docs
All pages
Connections and security
Examples

Modules

Realtime Database

Values that the whole game shares and hears live: the version of the game, events, a leaderboard, a lobby. Values live at paths like config/version or lobby/rooms/7.

Reading and listening

TypeScript
const version = await ansekai.realtime.get("config/version");
const page = await ansekai.realtime.list("events", { limit: 50 });

const stop = ansekai.realtime.subscribe("config", (change) => {
  console.log(change.path, change.value);
});

subscribe gives what is there now and then every change at and under the path. It keeps a connection open, WebSocket when the module is on HTTP, and asks only for what it missed after a reconnect. One connection listens to 32 paths at most.

Writing

Only the panel and server code write, unless a path is Shared. A client writes a shared path with up to 4 KB, server code has the limits of the server.

await ansekai.realtime.set("lobby/players/mira", { ready: true });
await ansekai.realtime.delete("lobby/players/mira");

Listening clients hear a write of server code when its run ends well, a run that fails sends nothing.

Rules

The Paths tab of the settings says who reaches a path from a game client. A rule covers everything under its path, the closest rule wins:

AccessWho readsWho writes
PublicAnyone with the game key, even before signing inPanel and server code
PlayersSigned in playersPanel and server code
SharedSigned in playersSigned in players too
ServerNobody from a clientPanel and server code

Paths without a rule are Public unless you change the default. A client that writes where it may not gets read_only_path.

Limits

WhatLimit
A path256 characters, 16 levels deep
Paths of a game10,000
A value from a client4 KB
A page of list200 values

Updated November 21, 2026

Realtime Database · Ansekai Docs