3— Running Your Nodes In-Browser

Publish and subscribe in a browser

Using the finder, right click to open browser/publish.htmlin Chrome. The browser code will generate an id and print it on the page.

Copy the publisher id and paste it into the line ofbrowser/subscribe.jsthat sets subscriptionId.

// ID of the node to subscribing to
const subscriptionId1 = 'YOUR_SUBSCRIPTION_ID_HERE'

Using the finder, right click to open bowser/subscribe.htmlin Chrome. You should see the page print messages from the publisher as they arrive.


Really important

For using Nomad in a web browser, we've only tested with Chrome. There's also a bug we haven't fixed, where publishing and subscribing in the same running browser doesn't work, unless one of the windows is an incognito window.

results matching ""

    No results matching ""