Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ssb-client

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ssb-client

scuttlebot client

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
51
decreased by-7.27%
Maintainers
1
Weekly downloads
 
Created
Source

ssb-client v1

scuttlebot client


var Client = require('ssb-client')
var Keys = require('ssb-keys')

// desktop app:
var keys = Keys.loadOrCreateSync('./app-private.key')

// web app:
var keys
try {
  keys = JSON.parse(localStorage.keys)
} catch (e) {
  keys = Keys.generate()
  localStorage.keys = JSON.stringify(keys)
}

// connect:
var client = Client(keys, config)
  .connect(abortIf)
  .auth(Keys.createAuth(keys), abortIf)

// post to feed:
var feed = client.createFeed(keys)
feed.add({
  type: 'post', text: 'hello, world!'
}, function (err, msg) {
  abortIf(err)
  console.log(msg)
  client.close()
})

function abortIf (err) {
  if(err) throw err
}

License

MIT, Copyright 2015 Paul Frazee and Dominic Tarr

FAQs

Package last updated on 10 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc