aura-net-sdk
v1.1.3
Published
The official client SDK for AuraNet multiplayer engine
Readme
🌌 AuraNet SDK
The official client-side SDK for AuraNet, the high-performance distributed multiplayer engine.
🚀 Key Features
- Input-Authoritative Sync: Move from "Position-Based" to "Input-Based" sync for ultimate security.
- Industrial Anti-Cheat: Built-in Sequence ID validation, sliding window rate limiting, and Interest Management.
- Redis Efficiency: Powered by binary MsgPack encoding for O(1) high-frequency updates.
- Universal Primitives: Matchmaking, Turn-Management, and Spectator mode out of the box.
- Zero-Boilerplate: Designed to work seamlessly with React and other modern frameworks.
📦 Installation
npm install aura-net-sdk🎮 Quick Start (State Management)
import { AuraClient } from "aura-net-sdk";
// 1. Initialize
const aura = new AuraClient("YOUR_API_KEY", "wss://aura-net.onrender.com");
// 2. Listen for Authoritative Server Snapshots
aura.on("stateUpdate", (world) => {
// Received data is filtered by "Interest Management"
myGame.render(world);
});
// 3. Send Intent/Input (🛡️ Replay Protected)
const movePlayer = (keys) => {
aura.sendInput({
keys,
seq: currentSeq++,
});
};
aura.connect();🎫 Matchmaking & Lobby
// Find a room based on criteria
const room = await aura.matchmake({ map: "volcano", mode: "deathmatch" });
// Coordinates with others
aura.setTeam("red");
aura.toggleReady(true);
aura.on("lobbyUpdate", ({ playerId, data }) => {
console.log(`${playerId} is now ${data.ready ? "Ready" : "Not Ready"}`);
});🛠️ API Reference
Methods
connect(): Opens the connection.sendInput(input): Send authoritative input commands (replaces setLocalState for security).getRoomState(): Returns the local world-replica.matchmake(criteria): Search/Join the best match.joinMatchmaking(criteria): Enter the global matchmaking queue.endTurn(nextPlayerId): Authoritative turn switching for strategy games.joinSpectator(roomId): Passive observation mode.setTeam(name): Lobby team selection.toggleReady(bool): Pre-game readiness toggle.
AuraNet: Build fast, scale forever.
