You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varssbClient=require('ssb-client')varssbKeys=require('ssb-keys')// simplest usage, connect to localhost sbot// this will cb with an error if an sbot server is not runningssbClient(function(err,sbot){// ...})// configuration:varkeys=ssbKeys.loadOrCreateSync('./app-private.key')ssbClient(keys,// optional, defaults to ~/.ssb/secret{host: 'localhost',// optional, defaults to localhostport: 8008,// optional, defaults to 8008key: keys.id,// optional, defaults to keys.idcaps: {// random string for `appKey` in secret-handshakeshs: ''},// Optional muxrpc manifest. Defaults to manifest provided by server.manifest: {}},function(err,sbot,config){// ...})
Tutorials using this library to create basic clients: ssb-client-basic
A simple command line wrapper around this library: ssb-client-cli
api
require('ssb-client') => createEasyClient
createEasyClient(cb(err, sbot))
Create a connection to the local ssb-server instance, using the default keys.
Configuration and keys will be loaded from directory specified by ssb_appname.
(by default ~/.ssb)
The manifest will be the manifest provided by that server.
Calling this without arguments is handy for scripts, but applications
should use the clearer apis.
there is a legacy api, that makes things as "easy" as possible,
by loading configuration and defaults. This is useful for scripts
but applications should probably use
caps.shs is a random string passed to secret-handshake. It determines which sbot you are able to connect to. It defaults to a magic string in this repo and also in scuttlebot