@smscode/sdk v1.0.0
First public release of the official TypeScript/JavaScript SDK for the SMSCode virtual-number API — rent temporary phone numbers and receive OTP/SMS verification codes programmatically.
Highlights
- Two API surfaces:
/v1(IDR integer money) and/v2(USD money objects +meta.fx) — pick one per integration. - Typed client: orders (
create/waitForOtp/finish/cancel/resend), catalog, balance, webhooks. - Webhook signature verification —
verifyWebhookSignaturerecomputes the HMAC-SHA256 over the raw bytes in constant time;parseWebhookEventreturns typed events. - Idempotency keys on order creation, typed errors (16 stable codes → subclasses), and retry honoring
Retry-After. - Dual ESM + CJS; full TypeScript types generated from the OpenAPI contract.
Install
npm i @smscode/sdk # or: bun add @smscode/sdk
Docs
- OpenAPI contract: https://smscode.gg/openapi.yaml
- AI-agent integration guide: https://smscode.gg/docs/ai.md