# ssb-zero-conf-client

> Bring a netKey (caps.shs) and an ssb keypair and you get a working ssb client!

Latest version **1.0.1** (published 2020-09-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install ssb-zero-conf-client
pnpm add ssb-zero-conf-client
yarn add ssb-zero-conf-client
bun add ssb-zero-conf-client
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2020-09-01 |
| First published | 2020-09-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jan Bölsche |
| Maintainers | regular |
| Keywords | tre, bay of plenty |

## Links

- npm: https://www.npmjs.com/package/ssb-zero-conf-client
- Repository: https://github.com/regular/ssb-zero-conf-client
- Homepage: https://github.com/regular/ssb-zero-conf-client#readme
- Issues: https://github.com/regular/ssb-zero-conf-client/issues
- npm.io page: https://npm.io/package/ssb-zero-conf-client

## Dependencies (5)

- [debug](https://npm.io/package/debug.md) ^4.1.1
- [ssb-client](https://npm.io/package/ssb-client.md) ^4.9.0
- [pull-stream](https://npm.io/package/pull-stream.md) ^3.6.14
- [pull-abortable](https://npm.io/package/pull-abortable.md) ^4.1.1
- [ssb-discover-lan-peers](https://npm.io/package/ssb-discover-lan-peers.md) ^1.0.0

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2020-09-01
- 1.0.0 — 2020-09-01

## README

ssb-zero-conf-client
---

Bring a netKey (caps.shs) and an ssb keypair and you get a working ssb client!

This works by scanning the lan for broadcasts of ssb-servers with ssb-lan installed. I then connects to any server that broadcasts the correct netKey and tries to request its manifest. This will only work when the provided public key (keys.public) is allowed to do this, for example because it is listed in the server's `config.master`.


``` js
const client = require('ssb-zero-conf-client')
const ssbKeys = require('ssb-keys')

const netKey = 'FZ0EmZO8NAhI8BLk5F1gxdBOTOO42BV9V6R4+KZS77c='
const keys = ssbKeys.loadOrCreateSync(__dirname + '/keyfile')

client(netKey, keys, (err, ssb, opts) =>{
  if (err) return console.error(err.message)
  console.log('Connected to', opts.remote)
  ssb.whoami( (err, feed) =>{
    if (err) return console.error(err.message)
    console.log(feed.id)
    ssb.close()
  })
})
```

I built this for connecting to ssb-servers started by Bay Of Plenty. Run `bay-of-plenty -- --authorize keyfile` to authorize your public key with all ssb-servers spawned by Bay Of Plenty.

License: MIT

---
_Source: https://npm.io/package/ssb-zero-conf-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
