← Back to docs
@seriphxyz/react
React hooks for comments, reactions, forms, and subscriptions. Works with Next.js, Remix, Vite, and more.
Installation
npm install @seriphxyz/react Works with React 18+ and React 19. Compatible with Next.js, Remix, Vite, and more.
Quick Start
useSubscribe
import { useSubscribe } from "@seriphxyz/react"
function SubscribeForm() {
const { submit, status, message } = useSubscribe({
siteKey: "your-key"
})
return (
<form onSubmit={(e) => { e.preventDefault(); submit(email) }}>>
<input type="email" />
<button disabled={status === "loading"}>Subscribe</button>
</form>
)
} useReactions
import { useReactions } from "@seriphxyz/react"
function LikeButton() {
const { counts, userReactions, add, remove } = useReactions({
siteKey: "your-key",
pageId: "my-page"
})
const hasLiked = userReactions.includes("like")
return (
<button onClick={() => hasLiked ? remove("like") : add("like")}>
{hasLiked ? "Unlike" : "Like"} ({counts.like || 0})
</button>
)
} useComments
import { useComments } from "@seriphxyz/react"
function Comments() {
const { comments, post, status } = useComments({
siteKey: "your-key",
pageId: "my-page"
})
return (
<div>
{comments.map(c => <div key={c.id}>{c.content}</div>)}
</div>
)
} Available Hooks
useSubscribeuseReactionsuseCommentsuseFormuseWaitlistuseFeedbackusePolluseAnnouncementsuseViewCountsFull API Reference
For complete documentation including all hook options, return values, and TypeScript types, see the package README: