{"id":22485819,"url":"https://github.com/ssbc/ssb-invite","last_synced_at":"2025-06-22T23:06:09.259Z","repository":{"id":34015260,"uuid":"65113765","full_name":"ssbc/ssb-invite","owner":"ssbc","description":"\"followbot\" style invite codes for ssb","archived":false,"fork":false,"pushed_at":"2024-02-29T06:57:00.000Z","size":411,"stargazers_count":8,"open_issues_count":6,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-09T15:55:38.731Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","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":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2016-08-07T03:30:21.000Z","updated_at":"2022-02-28T09:16:13.000Z","dependencies_parsed_at":"2024-02-29T07:47:06.023Z","dependency_job_id":null,"html_url":"https://github.com/ssbc/ssb-invite","commit_stats":{"total_commits":59,"total_committers":9,"mean_commits":6.555555555555555,"dds":0.5423728813559322,"last_synced_commit":"c8b125f4da5ad2e26df534742f63bb66f144e364"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/ssbc/ssb-invite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbc%2Fssb-invite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbc%2Fssb-invite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbc%2Fssb-invite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbc%2Fssb-invite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ssbc","download_url":"https://codeload.github.com/ssbc/ssb-invite/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbc%2Fssb-invite/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260952806,"owners_count":23087924,"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":"2024-12-06T17:13:18.798Z","updated_at":"2025-06-22T23:06:09.226Z","avatar_url":"https://github.com/ssbc.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# ssb-invite\n\nInvite-token system, mainly used for pubs. Creates invite codes as one of ways of onboarding.\n\nGenerally this ends being used for pubs:\n\n- Users choose a pub from a [list of pubs](https://github.com/ssbc/ssb-server/wiki/Pub-Servers).\n- The chosen pub gives out an invite code to the user via the pub's website.\n- The user installs a Scuttlebutt client and copy and paste the invite code into the client's \"accept invite\" prompt.\n- The pub validates the invite code and follows back the new user, making them visible to other Scuttlebutt users.\n\nSoon, hopefully supercededed by [ssb-peer-invites](https://github.com/ssbc/ssb-peer-invites) but supported for backwards compatibity.\n\n## api\n\n### create ({uses, note, external, modern}, cb(err, invite_code))\n\nCreate a new invite code.\n\n- `uses` (number): How many times the invite can be used before it expires.\n- `note` (string): A note to associate with the invite code. The ssb-server instance will\n    include this note in the follow message that it creates when `use` is\n    called.\n- `external` (string): An external hostname to use\n- `modern` (boolean): if true the invite code will be a valid multiserver address.\n    - if modern is enabled, uses will be set to 1.\n    - :warning: \"modern\" invites with ipv6 addresses currently have some problems\n\nThis produces an invite-code which encodes the ssb-server instance's public address,\nand a keypair seed. The keypair seed is used to generate a keypair, which is then used to authenticate a connection with the ssb-server instance.\nThe ssb-server instance will then grant access to the `use` call.\n\n### accept(invite_code, cb)\n\nUse an invite code.\n\n - invite_code (string): an invite code returned by `create`\n\nThis connects to the server address encoded in the invite-code, then calls `use()` on the server.\nIt will cause the server to follow the local user.\n\n\n### use ({feed:feedId}), cb)\n\nThis method is used internally, it is called on the remote pub by your local instance\nwhen you call `accept`. To call `use` you must authenticate\nas a guest, by using the seed in an invite code, that was created by this pub.\n\n`use({feed: feed_id}, cb)`\n\nThis commands the receiving server to follow the given feed.\n\nAn invite-code encodes the ssb-server instance's address, and a keypair seed.\nThe keypair seed must be used to generate a keypair, then authenticate a connection with the ssb-server instance, in order to use this function.\n\n - `feed` (feedid): The feed the server should follow.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssbc%2Fssb-invite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fssbc%2Fssb-invite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssbc%2Fssb-invite/lists"}