Funnable
Facade that wires together every browser capability exposed by the Funnable SDK. Use `Funnable.init` inside an embedded game to hydrate runtime config and access chat, lobby, ranking, storage, and analytics helpers.
Funnable
Facade that wires together every browser capability exposed by the Funnable SDK.
Use Funnable.init inside an embedded game to hydrate runtime config and
access chat, lobby, ranking, storage, and analytics helpers.
Examples
import { Funnable } from "@fun-sdk/core";
const fun = Funnable.init();
fun.chat.connect(lobbyId, token);
fun.ranking.submitScore(playerScore);
fun.analytics.trackEvent("level_complete", { level: 5 });Members
config
config: FunnableConfigRuntime settings injected by the container.
chat
chat: FunnableChatChat helper scoped to the current game.
ranking
ranking: FunnableRankingLeaderboard helper scoped to the current game.
lobby
lobby: FunnableLobbyLobby helper for creating/joining multiplayer rooms.
storage
storage: FunnableStorageLocal storage namespaced with the game id.
analytics
analytics: FunnableAnalyticsLightweight analytics reporter that uses navigator.sendBeacon.
init
static init(overrides?: Partial<FunnableConfig>): FunnableCreates a fully wired SDK instance.
Automatically merges the injected window.__FUNNABLE__ object with
any overrides, which makes it easy to stub values in local development.
Examples
const fun = Funnable.init({ gameId: "local-dev" });
fun.storage.set("difficulty", "hard");