Skip to main content

Get Your API Key

Before you begin, get your free API key from multisynq.io/coder.

Create Your First Multisynq App

Step 1: Set Up HTML Structure

Create an HTML file with the Multisynq client library:

Step 2: Create Your Model

The Model contains your application logic and handles all state changes:

Step 3: Create Your View

The View handles user interaction and displays the current state:

Step 4: Start Your Session

Connect everything together and start your collaborative session:

Complete Example

Here’s the complete working example:

How It Works

Model-View Architecture

Multisynq uses a strict Model-View separation:
  • Model: Contains all application logic and state. Runs in a deterministic virtual machine to ensure synchronization.
  • View: Handles user interface and user input. Can read from the model but never writes to it directly.
  • Events: All communication between Model and View happens through events.

Automatic Synchronization

When you run this app:
  1. All users join the same session using the session name and password
  2. The Model runs identically on every user’s device
  3. User actions trigger events that are synchronized across all clients
  4. Every user sees the same counter value in real-time

Testing Your App

  1. Replace "your-api-key-here" with your actual API key
  2. Open the HTML file in your browser
  3. Use the QR code to join from other devices (or open the generated session URL in another browser)
  4. Click the buttons - all connected users will see the updates instantly!

Next Steps

Learn the Model API

Deep dive into Models, events, and state management

Learn the View API

Understand Views, user interaction, and UI updates

Session Management

Advanced session configuration and management

Real Examples

Explore comprehensive tutorials and examples