{"id":49416,"library":"ssb-fetch","title":"ssb-fetch","description":"ssb-fetch (v1.5.2) is a JavaScript library that enables using the browser's native fetch API to retrieve SSB (Secure Scuttlebutt) messages and blobs via ssb:// URLs. It provides a proxy server for development with tools like Insomnia and Postman, and plans to support PUT, POST, and DELETE for publishing. Stable with incremental updates, it differentiates by offering a standards-based approach to SSB interaction, utilizing fetch instead of custom protocols. Currently GET is stable; publishing via HTTP verbs is in design.","status":"active","version":"1.5.2","language":"javascript","source_language":"en","source_url":"https://github.com/av8ta/ssb-fetch/issues","tags":["javascript","p2p","ssb","fetch","agregore-browser"],"install":[{"cmd":"npm install ssb-fetch","lang":"bash","label":"npm"},{"cmd":"yarn add ssb-fetch","lang":"bash","label":"yarn"},{"cmd":"pnpm add ssb-fetch","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Utility to convert SSB sigil IDs to ssb:// URIs, used in proxy and client-side URL conversion.","package":"ssb-uri2","optional":true}],"imports":[{"note":"Proxy server started via npm script; no direct import needed for client-side fetch usage.","wrong":"node proxy.js","symbol":"proxy","correct":"npm run proxy"},{"note":"Library polyfills fetch for ssb:// scheme; no import needed, just use fetch directly after including the library in browser/Agregore.","wrong":"require('ssb-fetch')","symbol":"fetch","correct":"fetch('ssb://message/...')"},{"note":"Use ssb-uri2 to convert sigil IDs to URIs; ssb-fetch itself does not export this.","wrong":"const convertUri = require('ssb-uri2')","symbol":"convertUri","correct":"import { convertUri } from 'ssb-uri2'"}],"quickstart":{"code":"// 1. Start the proxy server (in a separate terminal):\n// npm run proxy\n\n// 2. In your JavaScript (browser or Agregore), fetch SSB messages via HTTP proxy:\nconst response = await fetch('http://localhost:4080/ssb://message/ssb:message/g3hPVPDEO1tRbWrY7wPZ4k9R9P3Y6qF6Y6qF6Y6qF6Y=');\nconst data = await response.json();\nconsole.log(data);\n\n// Alternatively, directly fetch ssb:// URIs in Agregore Browser:\n// const response = await fetch('ssb://message/g3hPVPDEO1tRbWrY7wPZ4k9R9P3Y6qF6Y6qF6Y6qF6Y=');\n// const data = await response.json();\n// console.log(data);","lang":"javascript","description":"Shows how to start the proxy server and use fetch to retrieve an SSB message via HTTP or directly in Agregore."},"warnings":[{"fix":"Convert sigil IDs to ssb:// URIs using ssb-uri2.","message":"ssb:// URIs are required; old sigil IDs (@, %, &) are not supported directly.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use other methods (e.g., SSB client library) for publishing.","message":"Proxy only works for GET requests; PUT/POST/DELETE for publishing not yet implemented.","severity":"gotcha","affected_versions":"1.5.2"},{"fix":"Modify proxy script or set PORT environment variable.","message":"The proxy server defaults to port 4080; if busy, you must manually set a different port.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use fetch with JSON body for now.","message":"Planned support for HTML form submissions (method='post') is not yet available.","severity":"deprecated","affected_versions":"1.5.2"},{"fix":"Set ssb_appname to the correct name (e.g., 'ssb-test') before starting proxy.","message":"ssb_appname environment variable must match the SSB app name (default 'ssb') or data directory will be wrong.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'agregor':92 'agregore-brows':91 'api':20 'approach':66 'base':65 'blob':28 'browser':16,93 'current':76 'custom':74 'delet':51 'design':86 'develop':37 'differenti':59 'enabl':13 'fetch':3,6,19,71,90 'get':77 'http':82 'increment':56 'insomnia':41 'instead':72 'interact':69 'javascript':10,87 'librari':11 'like':40 'messag':26 'nativ':18 'offer':61 'p2p':88 'plan':45 'post':49 'postman':43 'protocol':75 'provid':32 'proxi':34 'publish':53,80 'put':48 'retriev':22 'scuttlebutt':25 'secur':24 'server':35 'ssb':2,5,23,68,89 'ssb-fetch':1,4 'stabl':54,79 'standard':64 'standards-bas':63 'support':47 'tool':39 'updat':57 'url':30 'use':14 'util':70 'v1.5.2':7 'verb':83 'via':29,81","created_at":"2026-06-07T17:01:40.678867+00:00","updated_at":"2026-06-07T17:01:40.678867+00:00","problems":[{"fix":"Run 'npm run proxy' in separate terminal; ensure port 4080 is free.","cause":"Proxy server not running or wrong port.","error":"Error: connect ECONNREFUSED 127.0.0.1:4080"},{"fix":"Verify URI is correct and message/blob exists on your SSB node.","cause":"Invalid ssb:// URI or resource not found.","error":"TypeError: Failed to fetch"},{"fix":"Use proxy for http:// or ensure you're in Agregore browser that supports ssb:// scheme.","cause":"Using non-ssb:// URI with direct fetch in Agregore (e.g., http://).","error":"Error: Invalid URI scheme"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/av8ta/ssb-fetch/issues","github":"https://github.com/av8ta/ssb-fetch/issues","docs":null,"changelog":null,"pypi":null,"npm":"ssb-fetch","openapi_spec":null,"status_page":null,"smithery":null,"categories":["messaging"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}