Minimal Digistore24 (DS24) Node/TypeScript client with a tiny surface area and CJS output (Firebase Functions friendly).
npm install @sebastianmaierofficial/ds24-clientimport { DS24Client } from "@sebastianmaierofficial/ds24-client";
const client = new DS24Client({
apiKey: process.env.DS24_API_KEY as string
});
const ping = await client.testConnection();
const buyUrl = await client.createBuyUrl({
product_id: "12345",
buyer: {
email: "buyer@example.com",
first_name: "Ava",
last_name: "Lee",
readonly_keys: "email_and_name"
},
tracking: {
utm_source: "newsletter"
}
});
const upgrades = await client.listUpgrades();If you want full OpenAPI coverage, use the generated low-level client:
import { DS24GeneratedClient } from "@sebastianmaierofficial/ds24-client";
const client = new DS24GeneratedClient({ apiKey: process.env.DS24_API_KEY as string });
const upgrades = await client.listUpgrades();Current hand-written, supported endpoints:
testConnection()→GET /getUserInfocreateBuyUrl(params)→POST /createBuyUrllistUpgrades(params)→POST /listUpgrades
For the full API surface, use DS24GeneratedClient and refer to the bundled spec at openapi/bundled/openapi.bundle.yaml.
cp examples/env.example examples/.env
npm run example:smokeThis client uses your Digistore24 API key. Treat it like a password.
- Never use this library in browser/client-side JavaScript.
If you bundle it into frontend code, your API key will be exposed. - Use it server-side only (Node.js backend, Cloud Functions, Cloud Run, etc.).
- Store the API key in environment variables / secret managers, never in source code.
- Do not commit
.envfiles. Useenv.exampleas a template only. - If you suspect leakage, revoke/rotate the API key immediately in Digistore24.
The example scripts in /examples are intended for local server-side testing only.
npm run openapi:fetchdownloads the official spec and referenced YAMLs intoopenapi/raw/.npm run openapi:bundlebundles intoopenapi/bundled/openapi.bundle.yaml.
DS24_AUTH_FAILEDDS24_FORBIDDENDS24_RATE_LIMITEDDS24_NOT_FOUNDDS24_BAD_REQUESTDS24_TIMEOUTDS24_NETWORK_ERRORDS24_UNKNOWN
- Authentication uses the
X-DS-API-KEYheader as defined in the DS24 OpenAPI spec. - Requests are
application/x-www-form-urlencodedfor DS24 endpoints. - Retries: up to 3 attempts for 429/5xx/timeouts with exponential backoff.