Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Documentation

Complete, feature-by-feature documentation for @developerehsan/api-client — a typed, modular, universal API client factory for TypeScript.

Every page here is self-contained: it explains one feature, shows runnable code, and links to the exact example source that demonstrates it live. If you want one long top-to-bottom guide instead, read the project README.

New here? Start with Getting startedMental modelModules & methods. Then jump to whatever feature you need.


The two runnable examples

Everything in these docs is exercised by two apps you can run locally:

Example Stack Shows
examples/react-vite React + Vite (pure client-side) Direct typed client, TanStack Query, and an interactive Feature Lab for the pipeline
examples/nextjs Next.js App Router (SSR) The SSR RPC bridge — call api.module.method() from the browser without leaking the backend URL, paths, or OpenAPI

Both are backed by the free, CORS-enabled DummyJSON API, so they run with no backend setup.


Guides by topic

Foundations

The request pipeline

Beyond HTTP

Tooling

SSR & security

Practical


Feature → example map

Where to see each feature actually running:

Feature Doc Live in
Typed client wiring modules-and-methods react-vite/.../api.config.ts
Direct typed calls getting-started DirectClientDemo.tsx
Caching / SWR caching FeatureLab.tsx
Deduplication deduplication FeatureLab.tsx
Retries & backoff retries FeatureLab.tsx
Timeout / cancellation timeouts-and-cancellation FeatureLab.tsx
Typed errors / safeMode responses-and-errors FeatureLab.tsx
Composed multi-call modules-and-methods api.config.ts
ctx.run (non-HTTP) modules-beyond-http api.config.ts
Hooks & events hooks-and-events ui.tsx (useEventLog)
Bearer auth + login authentication api.config.ts
TanStack Query tanstack-query TanstackDemo.tsx
Codegen wiring codegen types/generated/
SSR RPC bridge ssr-rpc-bridge nextjs/lib/api/api.config.ts
RPC rate limiter rpc-rate-limiting nextjs/lib/api/api.config.ts
RPC batching ssr-rpc-bridge nextjs/lib/api/rpc-client.ts

Packages

Package Import Purpose
@developerehsan/api-client @developerehsan/api-client The runtime library
— server entry .../server SSR RPC bridge (server half)
— browser entry .../browser SSR RPC bridge (browser half)
— codegen entry .../codegen Node-only codegen functions
— testing entry .../testing Mock client & adapter
— cache-stores entry .../cache-stores Pluggable persistent cache stores
@developerehsan/api-client-cli npx @developerehsan/api-client Codegen CLI
@developerehsan/api-client-query .../query/{react,vue,solid} TanStack Query integration
@developerehsan/api-client-vite @developerehsan/api-client-vite Vite / TanStack Start codegen plugin