# vue-ssb

> VueJS Plugin to connect to Secure Scuttlebutt

Latest version **1.0.1** (published 2019-06-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install vue-ssb
pnpm add vue-ssb
yarn add vue-ssb
bun add vue-ssb
```

## 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 | 2019-06-06 |
| First published | 2019-04-21 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 6.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Joran Kikke |
| Maintainers | dangerousbeans |
| Keywords | vuejs, ssb, plugin, decentralized, p2p |

## Links

- npm: https://www.npmjs.com/package/vue-ssb
- Repository: https://github.com/dangerousbeans/vue-ssb
- Homepage: https://github.com/dangerousbeans/vue-ssb#readme
- Issues: https://github.com/dangerousbeans/vue-ssb/issues
- npm.io page: https://npm.io/package/vue-ssb

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) ^4.17.11
- [ssb-client](https://npm.io/package/ssb-client.md) ^4.7.2
- [ssb-server](https://npm.io/package/ssb-server.md) ^14.1.12

## Recent versions

- 1.0.1 (latest) — 2019-06-06
- 1.0.0 — 2019-04-21

## README

# Vue-SSB



## Usage

Start the suggested sbot server setup:

```shell
node ssb-server.js
```

Add vue-ssb to your app, provide the remote websocket address gotten by running `ssb-server ws.getAddress` against a normally started ssb-server

```javascript
import Vue from 'vue'
import App from './App.vue'

import ssbclient from 'vue-ssb'
Vue.use(ssbclient, { remote: "ws://localhost:9000~shs:TXKFQehlyoSn8UJAIVP/k2BjFINC591MlBC2e2d24mA=" })

new Vue({
  render: h => h(App),
}).$mount('#app')
```


Load some posts into your component. Note that the $ssb client must be loaded async.

```html
<template>
  <div class="messages">
    <h1>Posts</h1>
    
    {{ messages }}
  </div>
</template>

<script>
export default {
  data() {
    return {
      messages: []
    }
  }
  methods: {
    messages_loaded: function(err, messages)
    {
      this.$data.messages = messages
    }
  },
  mounted: function()
  {
    // Async fetch and connect ssb
    this.$ssb.then((ssb) => {
      console.log(ssb.id) // who you are

      // Load 100 posts
      pull(
        ssb.query.read( { limit: 100 } ),
        pull.filter(msg => msg.value.content.type === 'post'),
        pull.collect(this.messages_loaded)
      )
    })
  }
}
</script>
 ```

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