Help & Support

Bookmarks

This guide explain how to create Account's private bookmarks.

The bookmarks feature allows a user to save references to posts. The list is private to the authenticated Account, hence the owner and ANY Account Manager can access the list.

This feature is provided by the Lens API as a convenience to the user. The bookmarks are stored off-chain, so they are instant and do not require signatures or gas to use.

Add to Bookmarks

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

Use the bookmarkPost action to add a post to the Account's bookmarks list.

AddBookmark
import { postId } from "@lens-protocol/client";import { bookmarkPost } from "@lens-protocol/client/actions";

const result = await bookmarkPost(sessionClient, {  post: postId("01234…"),});
if (result.isErr()) {  return console.error(result.error);}

That's it—the post is now saved to the Account's bookmarks list.

List Bookmarks

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

Use the paginated fetchPostBookmarks action to list the Account's bookmarks.

import { fetchPostBookmarks } from "@lens-protocol/client/actions";import { client } from "./client";
const result = await fetchPostBookmarks(client);
if (result.isErr()) {  return console.error(result.error);}
// items: Array<Post | Repost>const { items, pageInfo } = result.value;

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

Remove from Bookmarks

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

Use the undoBookmarkPost action to remove a post from the Account's bookmarks list.

UndoBookmark
import { postId } from "@lens-protocol/client";import { undoBookmarkPost } from "@lens-protocol/client/actions";

const result = await undoBookmarkPost(sessionClient, {  post: postId("01234…"),});
if (result.isErr()) {  return console.error(result.error);}

That's it—the post is now removed from the Account's bookmarks list.