Client for buoy message forwarder.
The @greymass/buoy
package is distributed as a module on npm.
yarn add @greymass/buoy
# or
npm install --save @greymass/buoy
import {send} from '@greymass/buoy'
await send('hello', {service: 'https://cb.anchor.link', channel: 'my-unique-channel-id'})
import {receive} from '@greymass/buoy'
const message = await receive({service: 'https://cb.anchor.link', channel: 'my-unique-channel-id'})
import {Listener} from '@greymass/buoy'
const listener = new Listener({service: 'https://cb.anchor.link', channel: 'my-unique-channel-id'})
listener.on('message', (message) => {
console.log('message', message)
})
// make sure to subscribe to the error event or they will be thrown
listener.on('error', (error) => {
console.warn('listener error', error)
})
You need Make, node.js and yarn installed.
Clone the repository and run make
to checkout all dependencies and build the project. See the Makefile for other useful targets. Before submitting a pull request make sure to run make lint
.
Made with ☕️ & ❤️ by Greymass, if you find this useful please consider supporting us.