@strimz/sdk
The server SDK for Node.js + Bun.
The server SDK is the main way most teams use Strimz. It's fully typed, validates every response with Zod, and retries the right kinds of failures automatically (5xx errors and rate limits).
Install
Construct
The constructor doesn't make any network calls. The first time you call a method, it lazily initialises a fetcher with your config.
Resources
Every API resource is exposed as a property:
Each follows the same (create | retrieve | list | update | …) shape. Returns are typed:
Pagination
List methods return a { data, nextCursor, hasMore } envelope:
There's also a listAll async generator if you'd rather not manage the cursor:
Errors
Every error is a typed subclass of StrimzError. Catch the base class and instanceof-narrow as needed:
See Errors for the full list.
Webhook signature verification
Constant-time comparison; safe to use directly without wrapping in your own crypto.timingSafeEqual call.
Idempotency
create methods accept an idempotencyKey option. The SDK generates one automatically if you don't provide one:
See Idempotency.
Compatibility
- Node.js ≥ 18 (uses
fetch) - Bun ≥ 1.0
- Deno via the npm shim
- Cloudflare Workers (
@strimz/sdkis Edge-runtime safe. It usesglobalThis.fetchandWeb Crypto API, no Node-builtins)
