Closed hchiam closed 1 month ago
I also remember struggling with this, eventually I discovered I could access selfId as a global var (via variable hoisting?) : https://codeberg.org/coderofsalvation/xrfragment/src/branch/main/src/3rd/js/plugin/p2p/trystero.js#L54
however this example uses trystero-torrent.min.js, not the module version.
Thanks for the suggestion, I added a section early in the readme mentioning how to do this.
Hi! I'm new to trystero - From the current README, it didn't seem immediately obvious that for the js of a user to access their own peer ID
selfId
, you need to do an import likeimport {selfId} from './nostr.js'
I get that it's technically at the same level of indentation in the README as the other things listed under API (like
joinRoom
), but any thoughts on adding a code snippet here?Maybe we could add something like this?