Skip to content

how to get a list of peers accessing the same document? #398

Open
@michaelpalumbo

Description

is it possible to get a list of all peers currently working with the same document?

while having 3 browser tabs open, and successfully accessing the same document, i tried:

const repo = new Repo({
    network: [new BrowserWebSocketClientAdapter('ws://localhost:3030')],
    storage: new IndexedDBStorageAdapter("automerge");
});

// skipping the handle setup code....

await handle.whenReady();
console.log(repo.peers) 

but this returns an empty array.

  • also is there an event listener for catching when new peers connect or disconnect?*

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions