Skip to main content
A complete Multisynq application consists of two main components: a Model that contains all shared state and logic, and a View that handles user interface and input. This guide shows you how to structure and launch your applications.

Application Structure

Every Multisynq app requires exactly two classes: one Model and one View.
Essential application template
Critical: Every Model subclass must call .register("ClassName") with the exact class name.

Launching a Session

You need an API key from multisynq.io/coder to launch sessions.
Standard session setup
The autoSession() and autoPassword() helpers parse URL parameters and create random values if needed.

Session Lifecycle

Understanding the session lifecycle helps you build robust applications that handle joining, leaving, and persistence correctly.
What happens when you join a session
Critical: model.init() only runs for the first user in a session. Subsequent users get the model from a snapshot.

Main Loop Execution

Multisynq automatically manages the main loop, processing model events first, then view events, then rendering.
Default behavior (recommended)
Custom control for advanced applications
Specialized main loops for different game types

Best Practices

🏗️ Application Structure

Organize your code effectively

🔄 Session Management

Handle session lifecycle properly

🎯 Performance

Optimize for smooth gameplay

🛡️ Error Handling

Build resilient applications

Common Patterns

Next Steps

Writing a Multisynq Model

Deep dive into model development and constraints

Writing a Multisynq View

Learn advanced view patterns and user interface development

Events & Pub-Sub

Master communication between models and views

Simple Animation

See complete applications in action
Building a complete Multisynq application requires understanding both the technical structure (Model + View + Session) and the patterns for managing user interaction, state changes, and session lifecycle. Start with simple applications and gradually add complexity as you master these fundamentals.