Sync and storage: Jazz Cloud or self-hosted

For sync and storage, you can either use Jazz Cloud for zero-config magic, or run your own sync server.

Using Jazz Cloud

Sign up for a free API key at dashboard.jazz.tools for higher limits or production use, or use your email address as a temporary key to get started quickly.

.env

Replace the API key in the Jazz provider sync server URL with your API key:

<script lang="ts">
  import { JazzSvelteProvider } from "jazz-tools/svelte";
  import { MyAppAccount } from "$lib/schema";
  let { children } = $props();
  let apiKey = "Get a free API Key at dashboard.jazz.tools, or use your email as a temporary key.";
</script>

<JazzSvelteProvider
  sync={{ 
    peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
  }}
  AccountSchema={MyAppAccount}
>
  {@render children()}
</JazzSvelteProvider>

Jazz Cloud will

  • sync CoValues in real-time between users and devices
  • safely persist CoValues on redundant storage nodes with additional backups
  • make use of geographically distributed cache nodes for low latency

Free public alpha

  • Jazz Cloud is free during the public alpha, with no strict usage limits
  • We plan to keep a free tier, so you'll always be able to get started with zero setup
  • See Jazz Cloud pricing for more details

Self-hosting your sync server

You can run your own sync server using:

npx jazz-run sync

And then use ws://localhost:4200 as the sync server URL.

You can also run this simple sync server behind a proxy that supports WebSockets, for example to provide TLS. In this case, provide the WebSocket endpoint your proxy exposes as the sync server URL.

Requires at least Node.js v20. See our Troubleshooting Guide for quick fixes.

Command line options:

  • --host / -h - the host to run the sync server on. Defaults to 127.0.0.1.
  • --port / -p - the port to run the sync server on. Defaults to 4200.
  • --in-memory - keep CoValues in-memory only and do sync only, no persistence. Persistence is enabled by default.
  • --db - the path to the file where to store the data (SQLite). Defaults to sync-db/storage.db.

Source code

The implementation of this simple sync server is available open-source on GitHub.