Skip to main content
Set whether a bookmark is public, private, or inherits visibility from its parent group. This endpoint allows fine-grained control over individual bookmark visibility.

Endpoint

bookmark.setVisibility
Source: server/procedures/bookmarks.ts:178

Input

id
string
required
The ID of the bookmark to update
isPublic
boolean | null
required
Visibility setting:
  • true - Make bookmark public
  • false - Make bookmark private
  • null - Inherit visibility from parent group

Response

id
string
The bookmark ID
title
string
The bookmark title
url
string | null
The bookmark URL (null for color/text bookmarks)
isPublic
boolean | null
The updated visibility setting
groupId
string
The parent group ID
userId
string
The owner’s user ID
createdAt
string
ISO 8601 timestamp of creation
updatedAt
string
ISO 8601 timestamp of last update

Visibility inheritance

When isPublic is set to null, the bookmark inherits its visibility from the parent group:
  • If the group is public, the bookmark is visible on public profiles
  • If the group is private, the bookmark is hidden from public profiles
Setting an explicit true or false overrides the group’s visibility for this specific bookmark.

Usage examples

React Query (client component)

'use client';

import { client } from '@/lib/orpc';

function BookmarkVisibilityToggle({ bookmarkId }: { bookmarkId: string }) {
  const { mutate } = client.bookmark.setVisibility.useMutation();
  
  const handleMakePublic = () => {
    mutate({
      id: bookmarkId,
      isPublic: true,
    });
  };
  
  const handleMakePrivate = () => {
    mutate({
      id: bookmarkId,
      isPublic: false,
    });
  };
  
  const handleInheritFromGroup = () => {
    mutate({
      id: bookmarkId,
      isPublic: null, // Inherit from parent group
    });
  };
  
  return (
    <div>
      <button onClick={handleMakePublic}>Make public</button>
      <button onClick={handleMakePrivate}>Make private</button>
      <button onClick={handleInheritFromGroup}>Inherit from group</button>
    </div>
  );
}

Server component

import { serverClient } from '@/lib/orpc.server';

async function setBookmarkPublic(bookmarkId: string) {
  const bookmark = await serverClient.bookmark.setVisibility({
    id: bookmarkId,
    isPublic: true,
  });
  
  return bookmark;
}

Direct client

import { client } from '@/lib/orpc';

const bookmark = await client.bookmark.setVisibility.mutate({
  id: 'bookmark_id',
  isPublic: false, // Make private
});

console.log(`Bookmark visibility: ${bookmark.isPublic}`);