Node.js SDK
The Node.js SDK provides integration for JavaScript and TypeScript game servers.Installation
npm
yarn
Quick Start
JavaScript
server.js
TypeScript
server.ts
SDK Reference
Connection
Lifecycle Methods
Health Checking
Metadata
State Monitoring
Alpha Features
Player Tracking
Beta Features
Counters
Lists
Error Handling
All SDK methods return Promises. Use try-catch or.catch():
Best Practices
- Always use
awaitor.then()with SDK methods - Use
setIntervalfor health checks, not recursivesetTimeout - Clear intervals on shutdown
- Handle connection errors gracefully
Example
See the nodejs-simple example for a complete implementation.Next Steps
SDK Overview
Compare all available SDKs
API Reference
Complete SDK API documentation
