Skip to main content
The profile API manages user profiles, reading statistics, and activity feeds.

Get profile

Retrieve the current user’s profile information.
const profile = await orpc.profile.getProfile.query();

Response

id
string
User ID
name
string
Display name
email
string
User’s email address
bio
string | null
User biography/description
createdAt
string
ISO timestamp of account creation

Get statistics

Retrieve reading statistics for the current user.
const stats = await orpc.profile.getStats.query();

Response

totalBooks
number
Total books in user’s libraries
booksRead
number
Number of books with “completed” status
booksReading
number
Number of books with “reading” status
totalReadingTime
number
Total reading time in minutes
likedBooks
number
Number of books marked as liked
collections
number
Number of collections created by the user

Get activity feed

Retrieve the user’s recent reading activity.
const activity = await orpc.profile.getActivityFeed.query({
  limit: 20
});

Parameters

limit
number
default:"20"
Number of activity items to return

Response

Returns an array of activity events.
activities
array

Update profile

Update the current user’s profile information.
const updated = await orpc.profile.updateProfile.mutate({
  bio: "Avid reader and book collector"
});

Parameters

bio
string
User biography (max 500 characters)

Response

Returns the updated profile object.

Dashboard implementation

Example profile dashboard component:
import { useQuery } from '@tanstack/react-query';
import { orpc } from '@/utils/orpc';

function ProfileDashboard() {
  const { data: profile } = useQuery(
    orpc.profile.getProfile.queryOptions()
  );
  
  const { data: stats } = useQuery(
    orpc.profile.getStats.queryOptions()
  );
  
  const { data: activity } = useQuery(
    orpc.profile.getActivityFeed.queryOptions({ limit: 10 })
  );
  
  return (
    <div>
      <h1>{profile?.name}</h1>
      <p>{profile?.bio}</p>
      
      <div className="stats">
        <div>Books Read: {stats?.booksRead}</div>
        <div>Currently Reading: {stats?.booksReading}</div>
        <div>Reading Time: {stats?.totalReadingTime} min</div>
      </div>
      
      <div className="activity">
        <h2>Recent Activity</h2>
        {activity?.map(item => (
          <div key={item.id}>
            {item.type}: {item.bookTitle}
          </div>
        ))}
      </div>
    </div>
  );
}
All profile endpoints require authentication and only return data for the current user.

Build docs developers (and LLMs) love