{"id":26517246,"url":"https://github.com/fraction/ssb-content-stream","last_synced_at":"2026-03-11T15:31:18.271Z","repository":{"id":43053160,"uuid":"182333795","full_name":"fraction/ssb-content-stream","owner":"fraction","description":"stream method to get both blobs and content","archived":false,"fork":false,"pushed_at":"2022-12-03T11:38:39.000Z","size":682,"stargazers_count":5,"open_issues_count":5,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-07T01:11:20.435Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fraction.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-19T22:42:44.000Z","updated_at":"2020-12-11T15:07:42.000Z","dependencies_parsed_at":"2023-01-22T20:30:47.079Z","dependency_job_id":null,"html_url":"https://github.com/fraction/ssb-content-stream","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/fraction/ssb-content-stream","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fraction%2Fssb-content-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fraction%2Fssb-content-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fraction%2Fssb-content-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fraction%2Fssb-content-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fraction","download_url":"https://codeload.github.com/fraction/ssb-content-stream/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fraction%2Fssb-content-stream/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30385981,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T14:10:17.325Z","status":"ssl_error","status_checked_at":"2026-03-11T14:09:37.934Z","response_time":84,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-21T08:19:11.913Z","updated_at":"2026-03-11T15:31:18.250Z","avatar_url":"https://github.com/fraction.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ssb-content-stream\n\n\u003e Scuttlebutt stream of messages and off-chain content.\n\nThis plugin exposes a method that wraps `createHistoryStream` and returns all\noff-chain content referenced by those messages. This gives us the ability to\ndo deletion and feed replication without using the blob system.\n\n## Usage\n\n```javascript\nconst server = require('ssb-server')\n  .use(require('ssb-master'))\n  .use(require('./'))\n\nconst config = Object.assign({}, require('ssb-config'), {\n  keys: require('ssb-keys').generate() // Random key for testing!\n})\n\nconst ssb = server(config)\n\nssb.contentStream.publish({ type: 'test', randomNumber: 42 }, (err, msg) =\u003e {\n  if (err) throw err\n  console.log(msg.value.content)\n})\n```\n\n```javascript\n{ type: 'content',\n  href:\n   'ssb:content:sha256:rWqRaMb0dfFmss2xan936taWQFfJ_1GGOeckZrFUit8=',\n  mediaType: 'text/json' }\n```\n\n## API\n\n### createSource(opts)\n\nWrapper for [`createHistoryStream()`][0] that prepends all off-chain content to the\nstream. Since `createHistoryStream()` only returns public and unencrypted messages\nthis function will only return public messages and its content.\n\n### createHandler(cb)\n\nCreates a through-stream that filters content out of the stream, adds them to the\ncontent store, and only passes the original metadata message through the stream.\n\n### `getContent(msg, cb)`\n\nTakes a full message (`{ key, value: { previous, sequence, ... } }`) and\nreturns the extracted content from that message in `msg.value.content` as if\nit wasn't a message with off-chain content.\n\n### `getContent(opts)\n\nPasses `createSource()` through `createHandler()` and `getContent()`.\n\n### publish(content, cb)\n\nWraps `ssb.publish()` to publish off-chain messages that can be accessed with\ncontent streams. Message schema is:\n\n```json\n{\n  \"href\": \"ssb:content:sha256:rWqRaMb0dfFmss2xan936taWQFfJ_1GGOeckZrFUit8=\",\n  \"mediaType\": \"text/json\",\n  \"type\": \"content\"\n}\n```\n\n## Installation\n\nWith [npm](https://npmjs.org/):\n\n```shell\nnpm install ssb-content-stream\n```\n\nWith [yarn](https://yarnpkg.com/en/):\n\n```shell\nyarn add ssb-content-stream\n```\n\n## See Also\n\n- [Scuttlebutt Protocol Guide](https://ssbc.github.io/scuttlebutt-protocol-guide/)\n- [ssb-db](https://github.com/ssbc/ssb-db)\n- [ssb-blob-content](https://gitlab.com/christianbundy/ssb-blob-content)\n\n## License\n\nISC\n\n[0]: https://github.com/ssbc/ssb-db#ssbdbcreatehistorystream-id-feedid-seq-int-live-bool-limit-int-keys-bool-values-bool---pullsource\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffraction%2Fssb-content-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffraction%2Fssb-content-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffraction%2Fssb-content-stream/lists"}