<PostList profileHandle='nathancolosimo' />
Server (or client!) component that pulls the latest Substack posts for a handle and renders them with ShadcnItem primitives.
profileHandle needs to bea public Substack handle for a profile, NOT a publication.
pnpm dlx shadcn@latest add https://substack-react.nathancolosimo.com/r/post-list.json
<PostCard postId={150198789} />
Look up a single post by id and display it using the shared PostCardDisplay layout.
Pass any integer Substack post id, or fetch the post in a different way and use PostCardDisplay directly.
pnpm dlx shadcn@latest add https://substack-react.nathancolosimo.com/r/post-card.json
<Profile handle='nathancolosimo' />
Resolve a public Substack handle and present a card layout with cover, avatar, and link actions.
Need finer control? Install ProfileDisplay for a presentation-only version.
pnpm dlx shadcn@latest add https://substack-react.nathancolosimo.com/r/profile.json
Backend utilities
These helpers perform a fetch to Substack and validates the payload with Zod so downstream components receive typed data.
import { profileForHandle } from "@/lib/profile";async function loadProfile() { // Fetch the author profile once so you can share the id across other helpers. const profile = await profileForHandle("nathancolosimo"); return { profile };}pnpm dlx shadcn@latest add https://substack-react.nathancolosimo.com/r/profile-utils.json
import { postForId, publicationPostsForURL, userPostsForId, } from "@/lib/posts";import { profileForHandle } from "@/lib/profile";async function loadPosts() { // Fetch the author profile once so you can share the id across other helpers. const profile = await profileForHandle("nathancolosimo"); // Pull the ten latest posts for dashboards or newsletters. const latestPosts = await userPostsForId(profile.id, { limit: 10 }); // Hydrate a hero card with a specific post id. const featurePost = await postForId(latestPosts[0]?.id ?? 0); // Reuse publication data for landing pages, sorted newest-first by default. const publicationPosts = await publicationPostsForURL( "https://nathancolosimo.substack.com", { limit: 5 } ); return { profile, latestPosts, featurePost, publicationPosts };}pnpm dlx shadcn@latest add https://substack-react.nathancolosimo.com/r/post-utils.json




