{"id":28396230,"url":"https://github.com/ssbc/ssb-client","last_synced_at":"2025-06-11T19:37:29.439Z","repository":{"id":28134015,"uuid":"31633369","full_name":"ssbc/ssb-client","owner":"ssbc","description":"client library to scuttlebot","archived":false,"fork":false,"pushed_at":"2021-10-15T14:53:22.000Z","size":132,"stargazers_count":47,"open_issues_count":5,"forks_count":26,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-06-01T08:12:38.426Z","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":"JohnStabler/TabletopCutoutGen","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":"2015-03-04T02:20:56.000Z","updated_at":"2024-04-26T18:19:13.000Z","dependencies_parsed_at":"2022-09-03T14:42:14.745Z","dependency_job_id":null,"html_url":"https://github.com/ssbc/ssb-client","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbc%2Fssb-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbc%2Fssb-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbc%2Fssb-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbc%2Fssb-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ssbc","download_url":"https://codeload.github.com/ssbc/ssb-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbc%2Fssb-client/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":258523268,"owners_count":22714657,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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:27.187Z","updated_at":"2025-06-11T19:37:29.432Z","avatar_url":"https://github.com/ssbc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ssb-client v2\n\n[Scuttlebot](https://github.com/ssbc/scuttlebot) client.\n\nCreate an [rpc connection](https://ssbc.github.io/scuttlebutt-protocol-guide/#rpc-protocol) to an sbot running locally.\n\n## example\n\n```js\nvar ssbClient = require('ssb-client')\nvar ssbKeys = require('ssb-keys')\n\n// simplest usage, connect to localhost sbot\n// this will cb with an error if an sbot server is not running\nssbClient(function (err, sbot) {\n  // ...\n})\n\n// configuration:\nvar keys = ssbKeys.loadOrCreateSync('./app-private.key')\nssbClient(\n  keys,                // optional, defaults to ~/.ssb/secret\n  {\n    host: 'localhost', // optional, defaults to localhost\n    port: 8008,        // optional, defaults to 8008\n    key: keys.id,      // optional, defaults to keys.id\n\n    caps: {\n        // random string for `appKey` in secret-handshake\n        shs: ''\n    },\n\n    // Optional muxrpc manifest. Defaults to manifest provided by server.\n    manifest: {}\n\n  },\n  function (err, sbot, config) {\n    // ...\n  }\n)\n```\n\n* Tutorials using this library to create basic clients: [ssb-client-basic](https://github.com/mixmix/ssb-client-basic)\n* A simple command line wrapper around this library: [ssb-client-cli](https://github.com/qypea/ssb-client-cli)\n\n## api\n\n### require('ssb-client') =\u003e createEasyClient\n\n#### createEasyClient(cb(err, sbot))\n\nCreate a connection to the local `ssb-server` instance, using the default keys.\nConfiguration and keys will be loaded from directory specified by `ssb_appname`.\n(by default `~/.ssb`)\n\nThe manifest will be the manifest provided by that server.\n\nCalling this without arguments is handy for scripts, but applications\nshould use the clearer apis.\n\nthere is a legacy api, that makes things as \"easy\" as possible,\nby loading configuration and defaults. This is useful for scripts\nbut applications should probably use\n\n##### createCustomClient({keys, config, manifest, remote}, cb(err, sbot))\n\nConnect to a specific server with fixed settings. All fields are mandatory.\n\n#### createLegacyClient(keys, opts, cb(err, sbot))\n\nConnect to a client with some custom settings.\n\nopts supports the keys:\n\n* `remote` multiserver address to connect to\n* `host, port, key` (legacy) if remote is not set, assemble address from host, port, key.\n* `manifest` use a custom manifest.\n\nIf you need custom options, it's recommended to use the `createCustomClient` API\ninstead, but this is still provided for legacy support.\n\n\n### keys\n\nSee [ssb-keys](https://github.com/ssbc/ssb-keys). The keys look like this:\n```js\n{\n    id: String,\n    public: String,\n    private: String,\n    curve: 'ed25519'\n}\n```\n\n### caps\n`caps.shs` is a random string passed to [secret-handshake](https://github.com/auditdrivencrypto/secret-handshake#example). It determines which sbot you are able to connect to. It defaults to a magic string in this repo and also in [scuttlebot](https://github.com/ssbc/scuttlebot/blob/master/lib/ssb-cap.js)\n\n```js\nvar appKey = Buffer.from(opts.caps.shs, 'base64')\n```\n\n\n## License\n\nMIT, Copyright 2015 Paul Frazee and Dominic Tarr\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssbc%2Fssb-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fssbc%2Fssb-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssbc%2Fssb-client/lists"}