Help & Support

Boost Engagement

This guide will show you the essential signal-boosting features on Lens.

Reposting

Users can repost any Post to their own Feed, another Feed, or even the Global Lens Feed. Reposting is an effective way for users to amplify content they find valuable and share it with their followers.

You MUST be authenticated as Account Owner or Account Manager to repost content on Lens.

1

Check Post Rules

First, inspect the post.operations.canRepost field to determine whether the logged-in Account is allowed to repost it. Some posts may have restrictions on who can repost them.

Check Rules
switch (post.operations.canRepost.__typename) {  case "PostOperationValidationPassed":    // Reposting is allowed    break;
  case "PostOperationValidationFailed":    // Reposting is not allowed    console.log(post.operations.canRepost.reason);    break;
  case "PostOperationValidationUnknown":    // Validation outcome is unknown    break;}

Where:

  • PostOperationValidationPassed: The logged-in Account can repost the Post.

  • PostOperationValidationFailed: Reposting is not allowed. The reason field explains why, and unsatisfiedRules lists the unmet requirements.

  • PostOperationValidationUnknown: The Post or its Feed (for custom Feeds) has one or more unknown rules requiring ad-hoc verification. The extraChecksRequired field provides the addresses and configurations of these rules.

Treat the PostOperationValidationUnknown as failed unless you intend to support the specific rules. See Post Rules for more information.

2

Repost a Post

Next, if the Post allows reposting, you can proceed to repost it.

You MUST repost on the same Feed as the original Post. Cross-feed quoting is currently not supported. If you find this feature valuable, please let us know by opening an issue.

Use the repost action to repost on Lens.

import { postId } from "@lens-protocol/client";import { repost } from "@lens-protocol/client/action";
const result = await repost(sessionClient, {  post: postId("42"),});
if (result.isErr()) {  return console.error(result.error);}

3

Handle Result

Then, handle the result using the adapter for the library of your choice:

import { handleOperationWith } from "@lens-protocol/client/viem";
// …
const result = await repost(sessionClient, {  post: postId("42"),}).andThen(handleOperationWith(walletClient));

See the Transaction Lifecycle guide for more information on how to determine the status of the transaction.

Reactions

Reactions let users express their opinion on a Post, providing immediate feedback to the Post's author on how their content resonates with the audience.

Currently, reactions are not stored on-chain. We plan to implement a decentralized solution in the future that maintains a smooth user experience while aligning with the web3 ethos.

Add a Reaction

At present, users can react to a Post with an upvote or downvote. In the future, more reaction options may be introduced to offer a wider range of engagement possibilities.

You MUST be authenticated as Account Owner or Account Manager to make this request.

Use the addReaction action to add a reaction to a Post.

Add Reaction
import { PostReactionType, postId } from "@lens-protocol/client";import { addReaction } from "@lens-protocol/client/action";
const result = await addReaction(sessionClient, {  post: postId("42"),  reaction: , PostReactionType.Upvote // or Downvote});
if (result.isErr()) {  return console.error(result.error);}
// Boolean indicating success adding the reactionconst success = result.value;

Undo a Reaction

Users can undo their reaction to a Post at any time.

You MUST be authenticated as Account Owner or Account Manager to make this request.

Use the undoReaction action to remove a reaction from a Post.

Undo Reaction
import { PostReactionType, postId } from "@lens-protocol/client";import { undoReaction } from "@lens-protocol/client/action";
const result = await undoReaction(sessionClient, {  post: postId("42"),  reaction: , PostReactionType.Upvote // or Downvote});
if (result.isErr()) {  return console.error(result.error);}
// Boolean indicating success adding the reactionconst success = result.value;

Fetch Reactions

Use the paginated fetchPostReactions action to fetch the reactions for a Post.

import { postId } from "@lens-protocol/client";import { fetchPostReactions } from "@lens-protocol/client/actions";
import { client } from "./client";
const result = await fetchPostReactions(client, {  post: postId("1234…"),});
if (result.isErr()) {  return console.error(result.error);}
// items: Array<AccountPostReaction>: [{account: Account, reactions: PostReaction}, …]const { items, pageInfo } = result.value;

See the Pagination guide for more information on how to handle paginated results.