Skip to main content
The Multisynq Data API provides secure bulk data storage for your applications. Instead of sending large files through the event system, you can upload data to Multisynq’s servers and share lightweight data handles that other users can use to fetch the content.

Core Concepts

The Data API separates large binary data from your synchronized model state, providing efficient and secure file sharing capabilities.
Data flow overview
Benefits: Efficient network usage, automatic caching, end-to-end encryption, and cleaner model state.

Basic File Upload and Sharing

Image sharing application

Persistence Integration

Data handles can be persisted and restored across sessions using Data.toId() and Data.fromId().
Converting handles for storage

Best Practices

🏗️ Model-View Separation

Keep data operations in the view

🔒 Security Considerations

Handle data securely

⚡ Performance Optimization

Optimize data handling

📱 Offline Handling

Handle network issues gracefully

Common Patterns

API Reference

Upload data and get a handle
Parameters:
  • arrayBuffer: ArrayBuffer containing the data to store
  • options.keep: Boolean - preserve original ArrayBuffer (transferred by default for efficiency)
  • options.shareable: Boolean - create handle that works across sessions
Returns: Promise that resolves to a data handle
Download data using a handle
Parameters:
  • handle: Data handle returned from store()
Returns: Promise that resolves to an ArrayBuffer
Convert handles for persistence
toId(handle): Convert handle to persistable string fromId(id): Recreate handle from string ID

Next Steps

Persistence

Learn how to persist data handles across sessions

Writing a Multisynq View

Master view patterns for handling user uploads

Multi-user Chat

See data sharing in action with file attachments

Simple Animation

Apply data techniques to animated content
The Data API enables powerful file sharing capabilities while maintaining security and performance. Use it for media content, documents, and any large binary data that would be inefficient to send through the event system. Remember to handle data operations in views and store only lightweight handles in your models.