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
User biography/description
ISO timestamp of account creation
Get statistics
Retrieve reading statistics for the current user.
const stats = await orpc.profile.getStats.query();
Response
Total books in user’s libraries
Number of books with “completed” status
Number of books with “reading” status
Total reading time in minutes
Number of books marked as liked
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
Number of activity items to return
Response
Returns an array of activity events.
Activity type: “started_reading”, “finished_book”, “added_to_collection”, “liked_book”
UUID of the book involved
ISO timestamp of the activity
Additional activity-specific data
Update profile
Update the current user’s profile information.
const updated = await orpc.profile.updateProfile.mutate({
bio: "Avid reader and book collector"
});
Parameters
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.