
Security News
pnpm 12’s Rust Rewrite Cuts Install Times by Up to 90%
pnpm 12 rewrites the package manager in Rust, cutting install times by up to 90% while preserving pnpm 11 workflows and lockfiles.
@synap-core/react
Advanced tools
React hooks and provider for Synap data pods. Built on TanStack Query + tRPC for real-time, type-safe data fetching.
npm install @synap-core/react
# or
pnpm add @synap-core/react
1. Wrap your app
import { SynapProvider } from "@synap-core/react";
export default function App() {
return (
<SynapProvider
podUrl="https://your-pod.synap.live"
apiKey="sk_live_..." // from Workspace → Settings → API Keys
workspaceId="ws_..."
>
<YourApp />
</SynapProvider>
);
}
2. Use hooks anywhere inside
import { useSynap } from "@synap-core/react";
function EntityList() {
const { data, isLoading } = useSynap().entities.list.useQuery({ limit: 20 });
if (isLoading) return <p>Loading...</p>;
return (
<ul>
{data?.items.map((entity) => (
<li key={entity.id}>{entity.title}</li>
))}
</ul>
);
}
function CreateNote() {
const create = useSynap().entities.create.useMutation();
return (
<button
onClick={() =>
create.mutate({
profileSlug: "note",
title: "New note",
properties: { content: "Hello!" },
})
}
>
Create note
</button>
);
}
<SynapProvider>| Prop | Type | Required | Description |
|---|---|---|---|
podUrl | string | ✓ | Data pod base URL (no trailing slash) |
workspaceId | string | ✓ | Workspace ID |
apiKey | string | — | Bearer token. Omit for cookie-based auth |
extraHeaders | Record<string, string> | — | Extra request headers |
queryClient | QueryClient | — | Reuse an existing TanStack Query client |
useSynap()Returns the full tRPC hook tree. Every procedure is available:
// Queries
useSynap().entities.list.useQuery(input);
useSynap().workspaces.get.useQuery();
useSynap().channels.list.useQuery({ workspaceId });
// Mutations
useSynap().entities.create.useMutation();
useSynap().entities.update.useMutation();
useSynap().chat.sendMessage.useMutation();
useSynapContext()Access the current pod URL and workspace ID inside a provider:
const { podUrl, workspaceId } = useSynapContext();
Thin, fully-typed wrappers over the most common reads — no need to remember
procedure paths. They are plain TanStack-Query hooks (accept enabled,
staleTime, etc. as a second argument):
import { useEntity, useEntities, useLinks, useView } from "@synap-core/react";
function Profile({ id }: { id: string }) {
const { data: entity } = useEntity(id); // entities.get
const { data: links } = useLinks(id); // relations.get (both directions)
return <h1>{entity?.entity?.title}</h1>;
}
function People() {
const { data } = useEntities("person", { limit: 50 }); // entities.list
return <ul>{data?.items.map((e) => <li key={e.id}>{e.title}</li>)}</ul>;
}
function MyView({ viewId }: { viewId: string }) {
const { data: view } = useView(viewId); // views.get
return <pre>{JSON.stringify(view, null, 2)}</pre>;
}
| Hook | Procedure | Notes |
|---|---|---|
useEntity(id, opts?) | entities.get | opts.includeProfile?: boolean |
useEntities(slug?, opts?) | entities.list | opts: { workspaceId?, projectId?, limit? } |
useLinks(entityId, opts?) | relations.get | opts.direction?: "source" | "target" | "both" (default both) |
useView(viewId, opts?) | views.get | — |
For anything else, drop down to useSynap() (the full tRPC tree).
import type { RouterInputs, RouterOutputs } from "@synap-core/react";
type CreateEntityInput = RouterInputs["entities"]["create"];
type EntityListOutput = RouterOutputs["entities"]["list"];
For non-React apps use @synap-core/sdk directly.
Full procedure reference: docs.synap.live/reference/api-reference
FAQs
React hooks and provider for Synap data pods
The npm package @synap-core/react receives a total of 13 weekly downloads. As such, @synap-core/react popularity was classified as not popular.
We found that @synap-core/react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
pnpm 12 rewrites the package manager in Rust, cutting install times by up to 90% while preserving pnpm 11 workflows and lockfiles.

Security News
Socket CTO Ahmad Nassri joins AppSec leaders at Black Hat to discuss active malware, package manager risks, and software supply chain defense.

Research
/Security News
Thirteen malicious Packagist themes expose visitors on unpatched iPhones to a WebKit-to-kernel exploit chain that steals device data and wallet seeds.