This repository is the documentation website for @dfsync/client.
@dfsync/client is a Node.js and TypeScript HTTP client for service-to-service communication. It focuses on reliable backend HTTP calls with retry, auth, lifecycle hooks, request metadata, response validation, and structured errors.
Package source:
Documentation website:
Documentation must match the current release branch or PR in the dfsync monorepo.
Before updating docs for a release, inspect the package source and tests instead of guessing behavior:
packages/client/src/index.tspackages/client/src/types/*packages/client/src/errors/*packages/client/src/core/request.tspackages/client/src/core/should-retry.tspackages/client/tests
If behavior is unclear, check the release branch or ask before documenting it.
Markdown docs live in:
docs/<package-slug>/<version>/*.md
Current @dfsync/client docs live in:
docs/client/v1/*.md
Docs are loaded by:
src/content/docsContent.ts
Default docs constants are defined in:
src/content/docsNavigation.ts
Package docs navigation and markdown imports are defined in docsPackages inside src/content/docsContent.ts.
When adding a new markdown page, add it to the relevant package/version entry in docsPackages unless the page is intentionally hidden.
The default docs package is client, so #/docs is treated as @dfsync/client documentation.
Canonical docs URLs use:
#/docs/<package-slug>/<version>/<page-slug>
For example:
#/docs/client/v1/getting-started
- Getting Started
- Installation
- Create Client
- Response Handling
- Auth
- Hooks
- Observability
- Retry
- Errors
- Examples
- API Reference
Keep these names and behaviors consistent across the docs:
baseUrl, neverbaseURLcreateClientget,delete,post,put,patch,request- auth strategies:
bearer,apiKey,custom - retry config:
attempts,retryOn,retryMethods,backoff,baseDelayMs - request metadata:
requestId,x-request-id - idempotency:
idempotencyKey,idempotency-key - response validation:
validateResponse,ResponseValidator,ValidationError - hooks:
beforeRequest,afterResponse,onError,onRetry - errors:
DfsyncError,HttpError,NetworkError,TimeoutError,ValidationError,RequestAbortedError
When preparing docs for a new @dfsync/client release:
- Compare the release branch against
maininpackages/client. - Check public exports from
packages/client/src/index.ts. - Check public config, request, hook, and auth types.
- Check new or changed error classes.
- Check tests for behavioral rules.
- Update relevant docs pages.
- Update
docsPackagesindocsContent.tsif adding pages or packages. - Run verification commands.
When adding docs for another package:
- Create
docs/<package-slug>/<version>. - Add the package to
docsPackagesinsrc/content/docsContent.ts. - Define package label, default version, default page slug, navigation, and markdown imports.
- Keep
clientas the default docs package unless the product direction changes. - Verify package routes under
#/docs/<package-slug>/<version>/<page-slug>.
npm run dev
npm run build
npm run typecheck
npm run lint
npm run format:check- Keep docs factual and implementation-aligned.
- Prefer examples that compile against the real public API.
- Do not document behavior unless it is confirmed by source or tests.
- Keep examples focused on backend and service-to-service use cases.
- Keep release notes and docs versioned around
@dfsync/client, not the full monorepo.