{"id":28396245,"url":"https://github.com/ssbc/ssb-social-index","last_synced_at":"2026-03-04T03:31:52.081Z","repository":{"id":45970998,"uuid":"177418494","full_name":"ssbc/ssb-social-index","owner":"ssbc","description":"scuttlebutt plugin for getting reduced state based on the author's social graph","archived":false,"fork":false,"pushed_at":"2021-11-23T12:33:39.000Z","size":41,"stargazers_count":5,"open_issues_count":4,"forks_count":2,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-11-27T10:46:02.331Z","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/ssbc.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-03-24T13:28:51.000Z","updated_at":"2021-11-23T12:33:39.000Z","dependencies_parsed_at":"2022-09-12T03:01:45.013Z","dependency_job_id":null,"html_url":"https://github.com/ssbc/ssb-social-index","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ssbc/ssb-social-index","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbc%2Fssb-social-index","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbc%2Fssb-social-index/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbc%2Fssb-social-index/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbc%2Fssb-social-index/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ssbc","download_url":"https://codeload.github.com/ssbc/ssb-social-index/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbc%2Fssb-social-index/sbom","scorecard":{"id":844516,"data":{"date":"2025-08-11","repo":{"name":"github.com/ssbc/ssb-social-index","commit":"339e9abd3d93a9bd2851549c08832634423f9558"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":2,"reason":"Found 4/20 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 14 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T21:08:42.843Z","repository_id":45970998,"created_at":"2025-08-23T21:08:42.851Z","updated_at":"2025-08-23T21:08:42.851Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30070756,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T03:25:38.285Z","status":"ssl_error","status_checked_at":"2026-03-04T03:25:05.086Z","response_time":59,"last_error":"SSL_read: 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-05-31T21:37:28.843Z","updated_at":"2026-03-04T03:31:52.047Z","avatar_url":"https://github.com/ssbc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ssb-social-index\n\n[scuttlebot](http://scuttlebutt.nz/) plugin for indexing reduced state based on the author's social graph.\n\n## Usage\n\nThis module exports a function that takes some options as an argument. It then returns a plugin that provides certain indexes determined by those options (see the API section below).\n\n```js\nconst Server = require('scuttlebot')\nconst config = { ... } // needs options\n\n// Install the plugin\nServer\n  .use(require('ssb-backlinks')) // required if not using ssb-db2\n  .use(require('ssb-social-index')({\n    namespace: 'edits',\n    type: 'update',\n    destField: 'root'\n  }))\n\n// Start the server\nconst server = Server(config)\n```\n\nIn this fictional example, we'd pick up messages of form:\n```js\n{\n  type: 'update',\n  root: '%aleq2po323j12j3s1l2j3s123z',\n  update: {\n    title: 'Scuttle Camp ~~One~~ Two'\n  }\n}\n```\n\nand provide social index methods at `server.edits[METHOD]`\n\n## API\n\nThe function exported by this module takes an option object with three mandatory fields:\n\n```js\n{\n  namespace: 'foo',\n  type: 'bar',\n  destField: 'baz'\n}\n```\n\nThese options will produce a plugin named `'foo'` that indexes over messages of type `'bar'`, matching `dest` arguments in the provided functions against a field called `'baz'` on the `'bar'` messages.\n\nFor all exposed functions, the `dest` argument must be a FeedId/MessageId.\n\nAfter calling the exported plugin with all options set to `'about'`, you get a plugin with the following API.\n\n### `server.about.socialValue({ key, dest }, cb)`\n\nWhere `dest` is a FeedId/ MessageId which is being described by some `about` messages, and `key` is the specific `about` property you want to know e.g.\n\n```js\nserver.about.socialValue({ key: 'name', dest: '@3r4+IyB5NVl2in6QOZHIu9oSrZud+NuVgl2GX3x2WG8=.ed25519' }, (err, value) =\u003e {\n  console.log(value)\n  // =\u003e 'Richard'\n})\n```\n\nThe default algorithm for the socialValue is based of the following priorities:\n1. the most recent value I have set for that `dest`/ `key` (if it exists)\n2. the most recent value that the 'owner' `dest` set for that key (if they've self assigned it)\n3. the most recent + 'popular' value for the `dest` / `key` (from all data in your network)\n\nYou can however provide your own custom algorithm using the option `getSocialValue`. (See code for details)\n\n### `server.about.latestValue({ key, dest }, cb)`\n\nSame as socialValue, except only gets the most recent value that's been announced by anyone for this `dest` / `key`\n\n### `server.about.socialValues({ key, dest }, cb)`\n\nReturns the most abouts for all people who have published things for this `key` / `dest`\n\n```js\nserver.about.socialValues({ key: 'name', dest: '@3r4+IyB5NVl2in6QOZHIu9oSrZud+NuVgl2GX3x2WG8=.ed25519' }, (err, values) =\u003e {\n  console.log(values)\n  // =\u003e {\n     '@3r4+IyB5NVl2in6QOZHIu9oSrZud+NuVgl2GX3x2WG8=.ed25519': 'Richard',\n     '@ye+QM09iPcDJD6YvQYjoQc7sLF/IFhmNbEqgdzQo3lQ=.ed25519': 'Dick'\n  }\n})\n```\n\n### `server.about.latestValues({ keys, dest }, cb)`\n\nNOTE - takes `keys` an Array of properties to return about a `dest`\nUses the same algorithm as latestValue, except you can get more than one value at once.\n\ne.g.\n```js\nserver.about.latestValues({ keys: ['title', 'image', 'location'], dest: '%Z1Kk8Aj8Bnw5+t4d73kRPHMA0Nj2bL1bx7n7obZhVZg=.sha256' }, (err, values) =\u003e {\n  console.log(values)\n  // =\u003e {\n    title: 'Picnic Birthday Party',\n    image: '\u0026asrg0Mb/w3lLC+yZIJr/4aY0nkWT9Wn+32zrqhaIvy4=.sha256',\n    location: 'Scorching Bay'\n  }\n})\n```\n\n### `server.about.socialValueStream({ key, dest })` =\u003e source\n\nSimilar to socialValue, except served over a stream. If the value changes a new value is sent down the stream\n\n```js\npull(\n  server.about.socialValueStream({ key: 'avatar', dest: '@3r4+IyB5NVl2in6QOZHIu9oSrZud+NuVgl2GX3x2WG8=.ed25519' }),\n  pull.drain(avatar =\u003e {\n    console.log(avatar)\n    // =\u003e '\u0026asrg0Mb/w3lLC+yZIJr/4aY0nkWT9Wn+32zrqhaIvy4=.sha256'\n    // (later) =\u003e '\u0026gwEYOFxfKxHSviAqeGub34eOIGXuuwn3G6odVNW9UtQ=.sha256'\n  })\n)\n```\n\n### `server.about.socialValuesStream({ key, dest })` =\u003e source\n\nSimilar to socialValues, except served over a stream. If the values change **only the new values** are emitted.\n\n```js\npull(\n  server.about.socialValueStream({ key: 'name', dest: '@3r4+IyB5NVl2in6QOZHIu9oSrZud+NuVgl2GX3x2WG8=.ed25519' }),\n  pull.drain(title =\u003e {\n    console.log(title)\n    // =\u003e {\n    //   '@3r4+IyB5NVl2in6QOZHIu9oSrZud+NuVgl2GX3x2WG8=.ed25519': 'Richard',\n    //   '@ye+QM09iPcDJD6YvQYjoQc7sLF/IFhmNbEqgdzQo3lQ=.ed25519': 'Dick'\n    // }\n    // (later) =\u003e {\n    //   '@ye+QM09iPcDJD6YvQYjoQc7sLF/IFhmNbEqgdzQo3lQ=.ed25519': 'Rich'\n    // }\n  })\n)\n```\n\n### `server.about.latestValueStream({ key, dest, authorId = null })` =\u003e source\n\nSame as latestValue expect a stream. First value emitted is the current value, subsequent are new values.\n\n```js\npull(\n  server.about.socialValueStream({ key: 'title', dest: '%Z1Kk8Aj8Bnw5+t4d73kRPHMA0Nj2bL1bx7n7obZhVZg=.sha256' }),\n  pull.drain(title =\u003e {\n    console.log(title)\n    // =\u003e 'Picnic Birthday Party'\n    // (later) =\u003e 'Beach Party'\n  })\n)\n```\n\nIf `authorId` is present, this provides a stream of values for a particular `dest` `key`, as asserted by that particular `authorId`\n\n### `server.about.read({ reverse = false, limit, live, old, dest })` =\u003e source\n\nA stream of all about messages that target `dest`\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssbc%2Fssb-social-index","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fssbc%2Fssb-social-index","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssbc%2Fssb-social-index/lists"}