@questud/sdk
v0.1.0
Published
Official Questud Custom API SDK for Node.js and TypeScript
Readme
@questud/sdk
Official Node.js / TypeScript client for the Questud Custom API.
npm install @questud/sdkimport { Questud } from '@questud/sdk'
const questud = new Questud({
apiKey: process.env.QUESTUD_API_KEY!,
businessId: process.env.QUESTUD_BUSINESS_ID,
baseUrl: process.env.QUESTUD_API_URL, // default: production API host
})
await questud.events.track('order.created', {
id: order.id,
customer_id: order.customerId,
total: order.total,
currency: order.currency,
})
await questud.orders.created({ id: order.id, total: order.total, currency: 'USD' })
await questud.customers.created({ id: customer.id, email: customer.email })
await questud.payments.completed({ id: payment.id, amount: payment.amount, currency: 'USD' })The SDK handles:
Authorization: Bearer qst_live_…/qst_test_…- envelope construction (
schema_version,event_id,external_id) - retries with exponential backoff on 429/502/503 and network failures
- request IDs (
X-Request-Id) - timeouts
- bulk ingest via
events.trackMany
It does not validate business-specific payloads. Questud’s server is the source of truth (GET /api/v1/events/contract).
Python, PHP, and other backends can follow the same HTTP contract; this package is the first official SDK.
