Publish content
Publishing content on Blurt starts with a comment operation. @beblurt/dblurt provides content builders so applications can construct posts, replies and updates before deciding how they will be signed or broadcast.
This guide is about building content operations. For signing and submission, read Broadcast safely.
The workflow
collect draft -> build operation -> preview/confirm -> sign/broadcast laterOperation builders are pure local helpers. They do not ask for private keys and do not broadcast transactions.
Top-level posts
import { buildPostOperation } from '@beblurt/dblurt';
const operation = buildPostOperation({
author: 'alice',
title: 'Hello Blurt',
body: 'Body text',
tags: ['blurt', 'sdk'],
app: 'my-app/1.0'
});
console.log(operation[0]); // comment
console.log(operation[1]); // operation payloadA top-level post uses the first normalized tag as the operation category. The builder returns a normal Layer 1 comment operation tuple.
Replies
import { buildReplyOperation } from '@beblurt/dblurt';
const operation = buildReplyOperation({
author: 'alice',
parentAuthor: 'bob',
parentPermlink: 'hello-blurt',
body: 'Thanks for the post!',
app: 'my-app/1.0'
});Replies have a parent author and parent permlink. They do not need a title.
Updates
import { buildUpdateOperation } from '@beblurt/dblurt';
const operation = buildUpdateOperation({
author: 'alice',
permlink: 'hello-blurt',
title: 'Updated title',
body: 'Updated body',
tags: ['blurt', 'sdk'],
app: 'my-app/1.0'
});Updates should be based on caller-supplied identity fields. Do not guess the author or permlink in the SDK layer.
Metadata and tags
The builders normalize tags and construct json_metadata using ecosystem conventions. There is no Layer 1 protocol rule that this SDK should present as a universal content policy.
Application policy remains outside the builder:
- moderation rules;
- tag allow/deny lists;
- title/body validation beyond SDK input checks;
- attribution footers;
- confirmation UX;
- account/key ownership checks.
Delete content
Blurt Layer 1 has a delete_comment operation for deleting content by author and permlink.
Use buildDeleteCommentOperation() when you want the same preview/external-signing pattern as the publish, reply and update builders:
import { buildDeleteCommentOperation } from '@beblurt/dblurt';
const operation = buildDeleteCommentOperation({
author: 'alice',
permlink: 'hello-blurt'
});For direct broadcast, use the dedicated broadcast helper after user confirmation and posting-authority key handling:
await client.broadcast.deleteComment({
author: 'alice',
permlink: 'hello-blurt'
}, postingKey);The underlying operation remains the Layer 1 tuple:
import { type DeleteCommentOperation } from '@beblurt/dblurt';
const operation: DeleteCommentOperation = ['delete_comment', {
author: 'alice',
permlink: 'hello-blurt'
}];Do not present deletion as a draft/update. It is a separate broadcast operation with side effects and should go through the same confirmation and authority checks as other broadcast operations.
Preview before broadcast
A good publishing UI shows users the content operation before signing:
const [, payload] = operation;
console.log({
author: payload.author,
permlink: payload.permlink,
title: payload.title,
parentAuthor: payload.parent_author,
parentPermlink: payload.parent_permlink
});Only after confirmation should the application enter a signing or broadcast flow.
Validated example
Related docs
- Assets, operations and transactions
- Social actions
- Broadcast safely
- Build post operation recipe
buildDeleteCommentOperationDeleteCommentOperation
