perch-ts
v0.0.2
Published
PolyAPI TS lean, proxy-based runtime SDK.
Readme
perch-ts 🦜
The TypeScript client for PolyAPI. perch-ts uses a JavaScript Proxy to dynamically route function calls to the PolyAPI backend — no code generation, no bloat.
Installation
# npm
npm install perch-ts
# pnpm
pnpm add perch-ts
# yarn
yarn add perch-tsHow it works
perch-ts creates a recursive Proxy object that intercepts property access and function calls. Each call is serialized and dispatched to the PolyAPI backend at runtime — the client itself has no knowledge of your specific API surface.
your code
│
▼
poly.namespace.functionName(args)
│
│ Proxy intercepts call, builds request:
│ { path: ["namespace", "functionName"], args }
│
▼
PolyAPI backend
│
▼
responseThis means:
- Faster server function executions
- No generated stubs to keep in sync
- New client functions are available without a redepoly
- The full API surface is available from a single set of imports
