
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
ssb-msg-schemas
Advanced tools
Functions to create common SSB messages.
{ type: 'post', text: String, channel: String, root: MsgLink, branch: MsgLink|MsgLinks, recps: FeedLinks, mentions: Links }
{ type: 'post-edit', text: String, root: MsgLink, revisionRoot: MsgLink, revisionBranch: MsgLink, mentions: Links }
{ type: 'about', about: Link, name: String, image: BlobLink }
{ type: 'contact', contact: FeedLink, following: Bool, blocking: Bool }
{ type: 'vote', vote: { link: Ref, value: -1|0|1, reason: String } }
{ type: 'pub', pub: { link: FeedRef, host: String, port: Number } }
var schemas = require('ssb-msg-schemas')
schemas.post(text, root (optional), branch (optional), mentions (optional), recps (optional), channel (optional))
// => { type: 'post', text: text, channel: channel, root: root, branch: branch, mentions: mentions, recps: recps }
schemas.postEdit(text, root, revisionRoot, revisionBranch, mentions (optional))
// => { type: 'post-edit', text: text, root: root, revisionRoot: revisionRoot, revisionBranch: revisionBranch, mentions: mentions }
schemas.name(id, name)
// => { type: 'about', about: id, name: name }
schemas.image(id, imgLink)
// => { type: 'about', about: id, image: imgLink }
schemas.follow(userId)
// => { type: 'contact', contact: userId, following: true, blocking: false }
schemas.unfollow(userId)
// => { type: 'contact', contact: userId, following: false }
schemas.block(userId)
// => { type: 'contact', contact: userId, following: false, blocking: true }
schemas.unblock(userId)
// => { type: 'contact', contact: userId, blocking: false }
schemas.vote(id, vote)
// => { type: 'vote', vote: { link: id, value: vote } }
schemas.vote(id, vote, reason)
// => { type: 'vote', vote: { link: id, value: vote, reason: reason } }
schemas.pub(id, host, port)
// => { type: 'pub', pub: { link: id, host: host, port: port } }
{ type: 'post', text: String, channel: String, root: MsgLink, branch: MsgLink|MsgLinks, recps: FeedLinks, mentions: Links }
channel is optionally used to filter posts into groups, similar to subreddits or chat channels.root and branch are for replies.
root should point to the topmost message in the thread.branch should point to the message or set of messages in the thread which is being replied to.root === branch, and both should be included.root and branch should only point to type: post messages. If the post is about another message-type, use mentions.mentions is a generic reference to other feeds, entities, or blobs.
mentions).mentions).recps is a list of user-links specifying who the message is for.
{ type: 'post-edit', text: String, root: MsgLink, revisionRoot: MsgLink, revisionBranch: MsgLink, mentions: Links }
text is used for posting the revised text that should take the place of some
previous text.root should point to the topmost message in the thread (i.e., the original
thread root).revisionRoot points the original 'unrevised message', i.e., the root of the
revision thread.revisionBranch should point to the previous revision in the revision
thread. If this is the first edit to a message, revisionRoot and
revisionBranch will be the same.mentions is used as in post, replacing the previous mentions of the
message in revisionBranch.{ type: 'about', about: Link, name: String, image: BlobLink }
name and image are votable.name and image should not appear in the same message.name and image are grouped together, a vote on the message is a vote on both pieces of information.type: about is for users, but it can also be used on msgs and blobs.FAQs
validation and publishing methods for common ssb message types
The npm package ssb-msg-schemas receives a total of 102 weekly downloads. As such, ssb-msg-schemas popularity was classified as not popular.
We found that ssb-msg-schemas demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.