DevelopmentSDK
SDK Overview
SDK Overview
Synap exposes your data pod as a fully-typed tRPC API. Two npm packages let you connect any app in minutes:
| Package | Use case |
|---|---|
@synap/sdk | Vanilla JS / TypeScript, server-side, scripts |
@synap/react | React apps — TanStack Query hooks, automatic caching |
Both packages are generated from the same AppRouter type, so autocomplete covers all 47+ procedures.
Installation
Step-by-step first calls (React, TS, cURL) → First queries.
Vanilla JS — @synap/sdk
React — @synap/react
1. Wrap your app with <SynapProvider>
2. Call useSynap() anywhere inside
Authentication
API key (recommended for external apps)
Generate a key in Workspace → Settings → Developer → API Keys. Pass it as apiKey — sent as a Bearer token.
Session cookie (browser — already logged in via Synap)
Omit apiKey. The SDK automatically sends credentials: "include" so the Kratos session cookie is forwarded.
Type helpers
Full procedure list
See the API Reference for every available query and mutation, auto-generated from the live router.
