question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can I use SyncedStore solely between tabs in one browser? (No signaling servers)

See original GitHub issue

It seems like it’s possible to use SyncedStore in multiple tabs in a browser, just locally. Just BroadcastChannel and y-indexeddb, no signaling servers, and I don’t think it would need any WebRTC activity.

I can share some code I’ve tried but first I just wanted to ask the question… Is there an official way to use it purely locally?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
YousefEDcommented, Dec 12, 2021

Hi @hangtwenty.

Broadcastchannel (cross tabs) and WebRTC syncing can both be managed using y-webrtc.

I think it should be possible to disable the webrtc part in y-webrtc, and use only the broadcastchannel. Could you try to pass an empty array as signaling servers? e.g.:

new WebrtcProvider("roomname", doc, { signaling: [] })

(see https://github.com/yjs/y-webrtc/blob/c059b8679e72e4a2cd59189b022a25edbd07cbeb/src/y-webrtc.js#L545)

0reactions
YousefEDcommented, Dec 16, 2021

Glad to hear!

Read more comments on GitHub >

github_iconTop Results From Across the Web

4 Ways to Communicate Across Browser Tabs in Realtime
You can use this feature to communicate across Browser Tabs, where other Tabs will receive the event once the storage is updated.
Read more >
Sync providers - Javascript CRDT based real-time sync
Communication over the signaling servers can be encrypted by providing a shared secret, keeping the connection information and the shared document private.
Read more >
JavaScript: sharing data between tabs - Stack Overflow
However, this means the data will only be accessible on the first page load of each tab. If you already have two tabs...
Read more >
Sharing state between browser tabs with Redux. - Dave Rivera
For this specific case we will try two different approaches, one by using no libraries you'll be guided through the process you have...
Read more >
yjs/yjs: Shared data types for building collaborative software
Communication over the signaling servers can be encrypted by providing a shared secret, keeping the connection information and the shared document private. y- ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found