@novahelm/client
v2026.6.1
Published
NovaHelm client — NovaRPC client and NovaState (createNovaApp / defineState).
Maintainers
Readme
@novahelm/client
Unified client SDK for NovaHelm — tRPC client setup with React Query, auth hooks, file uploads, remote config, push notifications, collection CRUD, module access, and design config.
Quick Start
pnpm add @novahelm/clientimport { createNovaClient, NovaProvider } from "@novahelm/client";
const client = createNovaClient({
baseUrl: "https://api.example.com",
projectSlug: "my-app",
});
export default function App({ children }) {
return (
<NovaProvider client={client}>
{children}
</NovaProvider>
);
}Auth Hook
import { useAuth } from "@novahelm/client";
function Profile() {
const { user, signIn, signOut, isLoading } = useAuth();
if (isLoading) return <span>Loading...</span>;
if (!user) return <button onClick={() => signIn()}>Sign In</button>;
return <span>Hello, {user.name}</span>;
}Collection Hooks
CRUD operations on platform collections (schema-builder tables):
import { useCollection, useCollectionRow, useCollectionMutation } from "@novahelm/client";
function PostsList() {
const { data, isLoading } = useCollection("posts", {
limit: 20,
orderBy: "createdAt",
});
return data?.map((post) => <div key={post.id}>{post.title}</div>);
}
function PostDetail({ id }) {
const { data: post } = useCollectionRow("posts", id);
const { create, update, remove } = useCollectionMutation("posts");
return <button onClick={() => update(id, { title: "Updated" })}>Save</button>;
}File Upload
import { useUpload } from "@novahelm/client";
function UploadButton() {
const { upload, progress, isUploading } = useUpload({
endpoint: "/api/upload",
onSuccess: (url) => console.log("Uploaded:", url),
});
return <input type="file" onChange={(e) => upload(e.target.files[0])} />;
}Module Hooks
Check module availability and access module extensions at runtime:
import { useModuleEnabled, useModuleConfig, useModuleComponent } from "@novahelm/client";
function FeatureGate() {
const enabled = useModuleEnabled("project-docs");
if (!enabled) return null;
const DocsWidget = useModuleComponent("project-docs", "sidebar-widget");
return DocsWidget ? <DocsWidget /> : null;
}API Reference
| Export | Description |
|--------|-------------|
| createNovaClient(config) | Create tRPC + React Query client |
| NovaProvider | React context provider for the client |
| useNovaClient() | Access the client instance from context |
| useAuth() | Authentication state and actions |
| useUpload(opts) | File upload with progress tracking |
| useConfig(key, opts) | Fetch configuration values by key |
| usePushNotifications() | Push notification registration and permissions |
| useExperiment(key) | A/B experiment variant access |
| useWebVitals(opts) | Core Web Vitals monitoring |
| useCollection(table, opts) | List collection rows with pagination |
| useCollectionRow(table, id) | Fetch a single collection row |
| useCollectionMutation(table) | Create, update, delete collection rows |
| useModuleEnabled(slug) | Check if a module is enabled |
| useModuleConfig(slug) | Get module configuration |
| useModuleComponent(slug, key) | Get a React component from a module |
| useModuleHook(slug, key) | Call a module hook function |
| useDesignConfig(opts) | Access resolved design/theme config |
