开发者社区> 镜像站> NPM> ssb-identities
ssb-identities
use multiple identities from a single sbot instance
Last updated a year ago by dominictarr .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install ssb-identities 
SYNC missed versions from official npm registry.

ssb-identities

manage multiple ssb identities, as an sbot plugin.

Usage

var createSbot = require('scuttlebot')
  .use(require('scuttlebot/plugins/master'))
  .use(require('scuttlebot/plugins/gossip'))
  .use(require('scuttlebot/plugins/replicate'))
  .use(require('ssb-identities'))

var sbot = createSbot(config)
// locally or via an remote ssb-client connection

sbot.identities.list(function (err, data) {
  // do things
})

This module uses the addUnboxer method of ssb db so that encrypted messages will be decrypted before being passed to database views.

API

identities.main (cb)

returns the main identity (sbot.id)

identities.list (cb)

returns the list of identities, with the main identity first.

identities.create (cb)

create a new identity, stored in ~/.ssb/identities/secret_[N].butt where N is the left-padded number of this identity. returns the id of the newly created identity.

The file created will use the ssb-keys format`

identities.publishAs({id:id, content: obj, private: boolean}, cb)

publish a message as a specific identity. id must be provided and must be already in the identities list. If private is true, content.recps must be set. recps must contain the id.

More information about sbot plugins

For more information about these type of plugins, refer to the plugins.md in the secret-stack repository.

License

MIT

Current Tags

  • 2.1.1                                ...           latest (a year ago)

14 Versions

  • 2.1.1                                ...           a year ago
  • 2.1.0                                ...           2 years ago
  • 2.0.9                                ...           2 years ago
  • 2.0.8                                ...           2 years ago
  • 2.0.7                                ...           2 years ago
  • 2.0.6                                ...           2 years ago
  • 2.0.4                                ...           2 years ago
  • 2.0.3                                ...           2 years ago
  • 2.0.2                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           3 years ago
  • 0.0.0                                ...           3 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (4)
Dev Dependencies (3)