useContent Hook
Fetch any content with a single hook. Automatic caching, revalidation, and optimistic updates built-in.
Real-time content sync, powerful React SDK, and component-based content models. Manage content in one place, deliver everywhere with your React stack.
import { useContent } from '@hisite/react-sdk';
function BlogPost({ slug }) {
const { data, loading } = useContent(slug);
if (loading) return <Spinner />;
return (
<article>
<h1>{data.title}</h1>
<div dangerouslySetInnerHTML={{ __html: data.body }} />
</article>
);
}
Everything you need to integrate content management into your React applications with minimal boilerplate and maximum performance.
Fetch any content with a single hook. Automatic caching, revalidation, and optimistic updates built-in.
Subscribe to real-time content changes. Your UI updates instantly when content changes in the CMS.
Full TypeScript support with generated types from your content models. Catch errors at build time.
Works seamlessly with Next.js, Remix, and any SSR framework. Server-side rendering with hydration.
Instant UI feedback for mutations. Rollback on errors automatically with built-in error handling.
Service worker integration for offline content access. Queue mutations and sync when back online.
See changes instantly across all connected clients. Your React app stays in sync with your CMS without page refreshes or polling.
Define your content structure as composable components. Reuse, nest, and extend models just like React components.
export const BlogPost = {
name: 'BlogPost',
fields: {
title: { type: 'string', required: true },
slug: { type: 'slug', from: 'title' },
author: { type: 'relationship', to: 'Author' },
content: { type: 'richText' },
tags: {
type: 'array',
of: { type: 'string' }
},
meta: { type: 'component', component: 'SEO' }
}
}
Build complex content structures by nesting components within each other. Hero sections, CTAs, and feature blocks as reusable pieces.
Non-technical team members can edit content visually while developers maintain control over the underlying structure.
Every change is tracked. Roll back to any previous version, compare diffs, and restore with confidence.
Automatically generate TypeScript types, GraphQL schemas, and API clients from your content models.
Drop-in integration with Create React App, Vite, Next.js, and every major React framework.
Zero config setup
Lightning fast HMR
SSR & SSG support
Full-stack integration
Static site generation
Mobile apps
From basic fetching to advanced patterns — see how simple it is to integrate HiSite.ai into your React apps.
import { useContent } from '@hisite/react-sdk';
function Homepage() {
const { data, loading, error } =
useContent('homepage');
if (loading) return <Loading />;
if (error) return <Error message={error.message} />;
return (
<main>
<h1>{data.hero.title}</h1>
<p>{data.hero.subtitle}</p>
</main>
);
}
import { useLiveQuery } from '@hisite/react-sdk';
function LiveBlog({ postId }) {
// Auto-updates when content changes
const { data } = useLiveQuery({
collection: 'posts',
id: postId
});
return (
<article>
<h1>{data?.title}</h1>
<time>{data?.updatedAt}</time>
<div>{data?.content}</div>
</article>
);
}
import { useCollection } from '@hisite/react-sdk';
function BlogList() {
const { docs } = useCollection({
collection: 'posts',
where: { status: 'published' },
sort: '-publishedAt',
limit: 10
});
return (
<ul>
{docs.map(post => (
<li key={post.id}>
<a href={post.slug}>{post.title}</a>
</li>
))}
</ul>
);
}
import { useMutation } from '@hisite/react-sdk';
function LikeButton({ postId, initialLikes }) {
const { mutate, isPending } = useMutation({
collection: 'posts',
id: postId
});
const handleLike = () => {
mutate({
likes: (prev) => prev + 1
});
};
return (
<button onClick={handleLike} disabled={isPending}>
❤️ {isPending ? 'Saving...' : 'Like'}
</button>
);
}
Everything you need to build with HiSite.ai — from quick starts to deep dives.
Comprehensive guides, API references, and configuration options for every use case.
Read DocsOpen source SDK, example projects, and community contributions. Star us on GitHub.
View on GitHubPre-configured templates for Next.js, Vite, and more. Deploy in minutes.
Browse TemplatesJoin 2,000+ developers. Get help, share projects, and connect with the team.
Join DiscordStart building with the React CMS that developers love. Free tier includes unlimited API requests.
No credit card required. Need enterprise features? Contact us.