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 make this request.
- TypeScript
- GraphQL
- React
Use the repost action to create a repost on Lens.
Repost
import { postId } from "@lens-protocol/client";import { repost } from "@lens-protocol/client/action";
const result = await repost(sessionClient, { post: postId("42"), // feed: evmAddress("0xabc123…"), // Optional});
if (result.isErr()) { return console.error(result.error);}
- TypeScript
- GraphQL
- React
Then, handle the result using the adapter for the library of your choice:
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.
- TypeScript
- GraphQL
- React
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.
- TypeScript
- GraphQL
- React
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
- TypeScript
- GraphQL
- React
Use the paginated fetchPostReactions action to fetch the reactions for a Post.
See the Pagination guide for more information on how to handle paginated results.