Developer platform

Build one app. It works on every pod.

Each person signs in to your app with their own pod and picks the spaces it sees. Their data stays in their pod. You read and write it with @synap-core/sdk.

Sign people in with their own pod.

Your app is a client of each person's pod. They type their pod's address, see what you ask for and why, and choose the spaces. They can take it back any time.

  1. Install the SDK.
    npm install @synap-core/sdk
  2. Say what you need. Each request names a permission and the reason the pod’s consent screen shows.
  3. Mount four routes. Your client metadata, connect, callback and disconnect. They are Web-standard handlers: Next.js, Hono, Remix, edge runtimes.
  4. Add a connect form. It posts the person’s pod address to your connect route.
// lib/synap.ts (server only)
import { createPodAppAuth } from "@synap-core/sdk/connect";

export const synap = createPodAppAuth({
  appUrl: "https://notes.example.com",
  clientName: "Notes",
  requests: [
    { permission: "entity.note.read", reason: "Show your notes" },
    { permission: "entity.note.create", reason: "Save new notes to your pod" },
  ],
  secret: process.env.SYNAP_APP_SESSION_SECRET!, // 32+ characters
});

// app/.well-known/synap-client.json/route.ts
export const GET = synap.handlers.clientMetadata;

// app/api/synap/connect/route.ts (a form posts "pod": their address)
export const POST = synap.handlers.connect;

// app/api/synap/callback/route.ts
export const GET = synap.handlers.callback;

// app/api/synap/disconnect/route.ts
export const POST = synap.handlers.disconnect;
@synap-core/sdk/connect · server only · npm

Read and write their pod.

Once connected, synap.client(connection) works on the spaces the person granted, and nothing else.

  • Writes can wait for review. Your app acts as an agent, so a write may come back as proposed. That is success: show the review link and never retry.
  • Calls are budgeted. By default a pod allows 3,000 reads and 500 writes per 15 minutes; its owner can change both. Over the budget, a call answers rate_limited with the wait in seconds.
  • The token stays on your server. It is sealed in an HttpOnly cookie; the browser never sees it.
  • Use the person’s tools. pod.actions.request asks their pod to run one of their tools. Anything that leaves the pod (a post, a message, an invitation) waits for their yes.
  • Develop without a pod. On localhost, sign in to the mock pod from @synap-core/sdk/testing. Real pods accept apps on https only: use a tunnel.
// a server component or route handler
const connection = await synap.readConnection(
  (await headers()).get("cookie"),
);
if (!connection) redirect("/connect");

const pod = synap.client(connection);
const [space] = pod.spaces(); // the spaces the person picked

const notes = await pod.listEntities({
  workspaceId: space.workspaceId,
  profileSlug: "note",
});

const res = await pod.post("/entities", {
  profileSlug: "note",
  workspaceId: space.workspaceId,
  title: "Hello from Notes",
});
if (res.ok && res.status === "proposed") {
  // Waiting for the person's review: show res.reviewUrl.
}
if (!res.ok) res.error.code; // expired, forbidden, rate_limited, …
@synap-core/sdk/connect · paths are Hub API paths · Docs: Hub REST API →

One package, four entries.

Import only what your code needs from @synap-core/sdk.

Scripts and servers: API keys.

A script, a CLI or a server working on your own pod uses an API key with @synap-core/hub-rest-client, against the pod's /api/hub/* routes.

  1. Create an API key on your pod and choose its scopes.
  2. Install the client. TypeScript, no runtime dependencies.
    npm install @synap-core/hub-rest-client
  3. Call the Hub. Search, create, update. Keys are not accepted by createSynapClient.
import { HubRestClient } from "@synap-core/hub-rest-client";

const hub = new HubRestClient({
  podUrl: "https://your-pod.synap.live",
  apiKey: process.env.SYNAP_HUB_API_KEY!, // synap_hub_… or synap_user_…
  workspaceId: "ws_…",
});

const notes = await hub.searchEntities("apollo proposal", {
  profileSlug: "note",
  limit: 20,
});

await hub.createEntity({ profileSlug: "task", title: "Write the brief" });
@synap-core/hub-rest-client · npm

Granular scopes.

An API key holds only the scopes you choose. Read does not imply write. The scopes a key can carry:

  • read:entities
  • write:entities
  • hub-protocol.read
  • hub-protocol.write
  • mcp.read
  • mcp.write
  • skills.invoke
  • chat.stream
  • realtime:observe

Connect the agent you already use.

The Synap CLI writes the MCP config for your client and signs it in to your pod. Web clients like claude.ai and ChatGPT use the Synap Cloud connector instead.

Set up in one line: it signs you in, finds or starts your pod and connects the agents on this computer.

npx @synap-core/cli init

Connect another agent later:

synap connect claude-code

Or paste the Cloud connector URL into a web client:

https://mcp.synap.live

In the docs: MCP · CLI reference · MCP tools

More to build on.