ssb-feed

2.3.0 • Public • Published

ssb-feed

A publishing interface for scuttlebutt feeds.

Track the state necessary to publish ssb feeds. This is built into secure-scuttlebutt, where it validates replicated messages, and it is also used "remotely" in patchbay.

By default, Scuttlebot uses a "master" identity/feed, which sbot.publish() will append new messages to. If you want to manipulate additional feeds, you can load the keypair and then use this library to do so.

Example

 
var ssbFeed = require('ssb-feed')
var ssbClient = require('ssb-client')
var ssbKeys = require('ssb-keys')
 
var alice = ssbKeys.generate()
ssbClient(function (err, sbot) {
  var feed = ssbFeed(sbot, alice)
 
  // Post to alice's feed
  feed.publish({
    type: 'post',
    text: 'hello world, I am alice.'
  }, function (err) { ... })
 
  // Also available:
  console.log(feed.id)
  console.log(feed.keys)
})

This example uses ssb-client, but, if you're embedding scuttlebot or the secure-scuttlebutt library into your process, you can use them locally.

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i ssb-feed

Weekly Downloads

20

Version

2.3.0

License

MIT

Last publish

Collaborators

  • powersource
  • arj03
  • staltz
  • mixmix
  • cel
  • mmckegg
  • christianbundy
  • dominictarr
  • marak
  • ahdinosaur
  • cryp7ix