TypeScript SDK
drazill — typed, native fetch, with a WebSocket client and webhook verification.
The drazill package is generated from the contract and MIT-licensed. Requires
Node.js 18+ (uses native fetch and FormData). Drazill is the canonical client export.
Install
The package is unscoped — drazill, not @drazill/sdk — so it matches the Python
package name on PyPI exactly.
An unconfigured client talks to staging (https://staging.drazill.com/api/v1), never
production — pass baseUrl or set DRAZILL_BASE_URL to target another environment.
Quickstart
Point the client at an environment with DRAZILL_BASE_URL (defaults to staging). List open
markets:
Lifted verbatim from the tested example sdks/typescript/examples/quickstart_markets.ts. See
Quickstart for the full walkthrough.
Place an order idempotently
Preview a quote, then place the order binding the quote token and an idempotency key, so a client-side retry can’t double-place:
WebSocket
Connect, then subscribe per channel with a handler. prices:{outcome_id} gives price ticks,
orderbook:{outcome_id} gives depth, trades:{market_id} gives the tape:
(client is the initialized Drazill client from the quickstart.)
Verify webhooks
Verify the signature before trusting an inbound webhook, then construct the typed event:
The full webhook contract (signing, retries, replay) is under Webhooks.
Retries, pagination & errors
The client accepts a maxRetries option (retries 5xx and 429, honouring Retry-After),
exports cursor iterators (paginateCursor / paginateOffset) for for await iteration, and
throws typed errors (ApiError, AuthenticationError, RateLimitError, ValidationError) —
RateLimitError.retryAfter carries the backoff. See the SDK README and
Rate limits.

