← Back to docs
@seriphxyz/core
Framework-agnostic API client, types, and headless controllers. Use this to build custom integrations or with any JavaScript framework.
Installation
npm install @seriphxyz/core
This is the base package used by @seriphxyz/astro,
@seriphxyz/react, and
@seriphxyz/solid.
Quick Start
Comments
import { fetchComments, postComment } from "@seriphxyz/core"
const comments = await fetchComments({
siteKey: "your-key",
pageId: "my-page"
})
await postComment({
siteKey: "your-key",
pageId: "my-page",
authorName: "John",
content: "Great post!"
}) Reactions
import { fetchReactions, addReaction } from "@seriphxyz/core"
const { counts, userReactions } = await fetchReactions({
siteKey: "your-key",
pageId: "my-page"
})
await addReaction({
siteKey: "your-key",
pageId: "my-page",
reactionType: "like"
}) Forms
import { submitForm } from "@seriphxyz/core"
await submitForm({
siteKey: "your-key",
formSlug: "contact",
data: { name: "John", email: "[email protected]", message: "Hello!" }
}) Subscriptions
import { subscribe } from "@seriphxyz/core"
await subscribe({
siteKey: "your-key",
email: "[email protected]"
}) Headless Controllers
Controllers manage state without any DOM dependencies. Use them to build custom UI or integrate with any framework.
import { SubscribeController } from "@seriphxyz/core"
const controller = new SubscribeController({ siteKey: "your-key" })
controller.subscribe((state) => {
console.log(state.status) // "idle" | "loading" | "success" | "error"
})
await controller.submit("[email protected]") SubscribeControllerFormControllerReactionsControllerCommentsControllerWaitlistControllerFeedbackControllerPollControllerAnnouncementsControllerViewCountsControllerFull API Reference
For complete documentation including all API functions, controllers, visitor management, and TypeScript types, see the package README: