{"repo":"RussBaz/svelte-synk","free":true,"listed":false,"github":"https://github.com/RussBaz/svelte-synk","clone":"git clone https://github.com/RussBaz/svelte-synk.git","description":"Svelte 5 cross-tab sync, leader election and task rollover on leader change (when leader tab is closed)","language":"TypeScript","stars":14,"topics":["broadcastchannel","cross-tab","indexeddb","leader-election","multi-tab","persistence","spa","state-sync","svelte","svelte5"],"license":"MIT","category":"saas-starters-boilerplates","readme_excerpt":"svelte-synk Svelte tab data synchronisation with leader election for Svelte 5 SPAs: - IndexedDB persistence - BroadcastChannel tab synchronisation - Leader-only tasks with Web Locks - Automatic transfer of scheduled tasks on leader change - Session-scoped or persistent lifetimes It makes it trivial to call token refresh endpoints or poll a remote API without flooding it with a separate call from every tab. Demo Table of Contents - Install - Quick Start - Core Concepts - Synced Stores - Store Metadata - Leader Tasks - Maintenance APIs - Shared utilities - Runtime and Lifecycle - API Snapshot - Notes and Trade-offs Install Quick Start Here is a basic example when using SvelteKit. Please wrap the root of your app with the provided helper component. Core Concepts Synced Stores Store Metadata Leader Tasks Maintenance APIs Shared utilities These are exported for use in your app or tests, with or without Synk. Runtime helpers If you use this library in a SvelteKit app, set the browser override so Synk uses the same environment as the SvelteKit app (e.g. in the root layout script, before ): If you don't set it, Synk falls back to checking window and document to detect the browser. Utility stores Runtime and Lifecycle API Snapshot Notes and Trade-offs - Browser support: Requires IndexedDB, BroadcastChannel, and Web Locks API (modern browsers). No fallback for older environments. - SSR: Stores can be created on the server; IDB sync and leader election run only in the browser. Use metad","default_branch":null,"files":null,"tree":[],"storefront":"/r/RussBaz","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/RussBaz/svelte-synk/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}