Skip to main content

Installation

The SDK is published as @podium-sdk/node-sdk on npm with full TypeScript type definitions.

Configuration

The SDK auto-detects the environment from your key prefix:

Environment Setup

Add your API key to your .env file:
Never commit API keys to version control. Always load them from environment variables or a secrets manager.

Custom Base URL

Override the auto-detected base URL for local development or custom deployments:

Multi-Tenant Context

Every API call is scoped to the organization that owns your API key. You don’t need to pass an organizationId — the Podium middleware extracts it from your key automatically. If your organization manages multiple creators, all creator-scoped operations (products, orders, campaigns) are accessible through your single API key:

SDK Namespaces

The SDK is organized into namespaces that mirror the API structure:

Basic Usage

Pagination

List endpoints return paginated results. Use page and limit parameters:

Pagination Response Shape

All paginated responses include a pagination object:

Iterate All Pages

Error Handling

The SDK throws typed errors with HTTP status codes and structured error bodies:

Error Codes

Validation Errors (422)

Podium uses Zod for request validation. Validation errors include field-level details:

Retry and Backoff

The SDK does not include automatic retries. Implement retry logic for transient errors:
For 429 responses, respect the Retry-After header when available.

Rate Limits

Rate limits are per-API-key and based on your subscription tier: Rate limit headers are included in every response:

SDK Generation

The SDK uses a hybrid generation approach:
  1. OpenAPI spec generated from Zod schemas via a build script
  2. Service classes auto-generated via openapi-typescript-codegen
  3. Wrapper layer maps generated services to clean namespaces
The SDK is regenerated from the Podium API’s OpenAPI spec whenever the API surface changes. Published versions on npm always reflect the latest API.

Versioning

The SDK follows semver. Breaking changes increment the major version:
Check the Podium API Playground for the latest endpoint documentation. The playground is always in sync with the production API.