Skip to content

feat: [#1] add @xedo/sdk node client for developer api v1#2

Merged
nahtandev merged 2 commits into
mainfrom
feat/1
Jun 12, 2026
Merged

feat: [#1] add @xedo/sdk node client for developer api v1#2
nahtandev merged 2 commits into
mainfrom
feat/1

Conversation

@nahtandev

Copy link
Copy Markdown
Member

Summary

Introduces @xedo/sdk, the official server-side Node.js/TypeScript client for the
Xedo Developer API v1, so e-commerce/SaaS templates share one typed, resilient API
layer instead of duplicating auth, retries, pagination and error handling.

Changes

  • Added Xedo client (src/client.ts): configurable apiKey, baseUrl,
    maxRetries, timeoutMs, injectable fetch, browser-env guard, environment
    and lastRateLimit getters
  • Added a fetch transport (src/transport.ts): Bearer auth, envelope unwrapping,
    automatic 429 retry (Retry-After + backoff/jitter, no 5xx auto-retry on
    POST /v1/carts), rate-limit capture, per-request timeout/abort, camelCase →
    wire (per_page, _sort, _order) mapping
  • Added the 5 resources ping, products, collections, orders, carts
    including pagination (list + listAll async iterator), binary invoice PDF, and
    the carts.createAndPay 502 checkout helper
  • Added typed error hierarchy (src/errors.ts) routed on code (XedoAuthError,
    XedoValidationError, XedoNotFoundError, XedoStockError, XedoConflictError,
    XedoRateLimitError, XedoPaymentInitError, XedoConnectionError)
  • Added hybrid types: generated mirror via openapi-typescript plus a hand-written
    public surface (src/types/public.ts)
  • Added vitest + msw tests (16 cases: success, errors, retry, pagination, invoice,
    createAndPay), tsup ESM+CJS+.d.ts build, eslint flat config, and GitHub
    Actions CI on Node 18/20/22
  • Added README, Next.js Server Component and Node script examples

@nahtandev nahtandev merged commit 2f7a8ba into main Jun 12, 2026
4 checks passed
@nahtandev nahtandev deleted the feat/1 branch June 12, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant