SDK Overview
The @selling-partner-api/sdk package is a server-side JavaScript/TypeScript client that mirrors the Amazon SP-API surface area. It is published from this repository whenever code changes land on main and has a hard dependency on the companion @selling-partner-api/models package.
What you get
- Generated typings sourced from Amazon's OpenAPI definitions.
- A composable
SpApiclient built on top ofopenapi-fetch. - Built-in LWA token management with refresh, grantless, and pre-provisioned token support.
- Adaptive rate limiting per schema path backed by token buckets.
- Helper clients (
ReportsClient,FinancesClient) that encapsulate the trickier workflows most teams end up writing. - End-to-end automation: nightly model syncs, release-please managed versioning, ordered publishing (models first, SDK second), and npm provenance attestation.
Release flow at a glance
- Land a PR that modifies
packages/modelsorpackages/sdk. - release-please updates (or opens) the per-package release PR with version bumps, changelog notes, and dependency alignment.
- Once checks pass, auto-merge lands the release PR, release-please tags the packages, and dedicated publish workflows push to npm/GitHub Packages with provenance.
You get reviewable release PRs and fully automated publishing without manual tagging.
Package structure
| Path | Purpose |
|---|---|
packages/models | Consolidated OpenAPI schema published as @selling-partner-api/models. |
packages/sdk | The runtime SDK published as @selling-partner-api/sdk. |
packages/sdk/scripts | Automation scripts (rate-limit generation, dependency sync). |
docs/sdk/* | The documentation you are reading right now. |
Runtime support
- Node.js ≥ 22.x (LTS) – leverages built-in
fetch,URL, and Web Streams. - Bun ≥ 1.2 – supported out of the box.
- Deno (server-side) – works when you provide compatible
fetch/Blobimplementations.
Browser runtimes are not supported because SP-API credentials must remain secret and rate-limiting requires server-side state.
Next steps
- Installation – add the package to your monorepo or service.
- Authentication – obtain and refresh LWA credentials.
- Usage Examples – call endpoints with full type support.
- Advanced Guides – customise rate limiting, middlewares, and transports.
- Testing & Tooling – unit test your integrations safely.
If something is missing, use the “Suggest changes” link in the footer or open an issue.