@drttix/drt-sdk
v1.1.2
Published
DRT SDK
Downloads
5,583
Keywords
Readme
DRT Public API
A unified NPM package for typed API clients generated from OpenAPI specs.
This package provides typed access to public services via fetch.
📦 Installation
npm install @drttix/drt-sdk📦 Usage
import { DRT } from "@drttix/drt-sdk";
const shopperGuid = "your-shopper-guid";
const account = "your-account";
const apiKey = "your-api-key";
const root = await DRT.shopper.account.getRoot(shopperGuid, account, apiKey);🛠️ Local Development (Developer Only)
For SDK contributors testing against a local API server:
// Option 1: Use localhost:3000
process.env.DRT_API_LOCAL = "true";
// Option 2: Use a custom base URL
process.env.DRT_API_BASE_URL = "http://localhost:8080";
import { DRT } from "@drttix/drt-sdk";Or via command line:
# Use localhost:3000
DRT_API_LOCAL=true npx tsx test.ts
# Use custom base URL
DRT_API_BASE_URL=http://localhost:8080 npx tsx test.tsNpm run generate Npm login Increment package.lock version Npm publish
