High-Level SDKs

Domain-specific SDKs built on top of @nolag/js-sdk. Each SDK provides a purpose-built API for a specific use case, handling topics, presence, reconnection, and state management out of the box.

All high-level SDKs share the same architecture: a MainClass attaches to the injected socket and manages lobby presence and rooms, while a RoomClass handles topic subscriptions and domain-specific state. Your app owns the one core client and its connect() / disconnect(); each wrapper releases its handlers with detach(). Each SDK peer-depends on @nolag/js-sdk ^1.12.0.

Every SDK expects an app created from its blueprint, which seeds the rooms and the online lobby it uses. Create it with NoLagApi.apps.create({ blueprintId }) or in the portal (Apps, New App, pick the blueprint), then pass the returned slug, which carries a random suffix, as the wrapper's appName. Each SDK page shows this step.

Architecture

Every high-level SDK follows the same invariant pattern:

LayerRoleExample
MainClassAttaches to the injected NoLagSocket, manages lobby presence, room join/leave, and re-runs setup after each reconnectNoLagChat, NoLagSignal
RoomClassWraps RoomContext, subscribes to domain topics, delegates to managersChatRoom, SignalRoom
ManagersHandle domain-specific state (stores, trackers, resolvers)MessageStore, PeerManager

Installation

Each SDK is published as a separate npm package:

npm install @nolag/chat @nolag/js-sdk

All SDKs peer-depend on @nolag/js-sdk ^1.12.0, which must be installed alongside.