Overview & Installation
Introduction to Nyota SMS and the official zero-dependency TypeScript SDK.
Nyota SMS is an enterprise telecommunications engine for transactional messaging, OTP verification, and high-volume marketing broadcasts.
Unlike standard SMS aggregators that drop failed messages into opaque queues, Nyota SMS provides local outbox queuing, live variable SMS merge templating, pre-flight cost estimation, and granular campaign controls (Approve, Pause, Resume, and Cancel/Purge).
Key Capabilities
- Dual-Balance Architecture: Fund dispatches using pre-purchased SMS Units or automate failovers with Pay-As-You-Go (PAYG) backed by your unified Nyota Wallet.
- Volume Tiered Pricing: Automated discounts scaling down from KSh 0.60 to KSh 0.40 per SMS unit.
- Local Outbox Queuing: Scheduled campaigns sit in your private outbox until the exact trigger moment, allowing you to pause or cancel broadcasts at any time before delivery.
- Dynamic Merge Templating: Personalize messages with placeholders like
{{firstName}}or custom data like{{invoice_no}}with built-in segment calculation. - Branded Sender IDs: Register and manage alphanumeric Sender IDs compliant with Communication Authority of Kenya (CAK) regulations.
Official SDK Installation
The @nyota/sms-sdk is a zero-runtime-dependency TypeScript library compatible with Node.js (>= 18.0.0), Bun, Deno, Next.js Edge, and Cloudflare Workers.
npm install @nyota/sms-sdkpnpm add @nyota/sms-sdkInitializing the SDK
Initialize the client with your Workspace API Key (ny_live_... or ny_test_...).
import { NyotaSms } from "@nyota/sms-sdk";
const sms = new NyotaSms({
apiKey: process.env.NYOTA_API_KEY!,
});The SDK automatically generates unique x-idempotency-key UUID headers on
mutating requests to guarantee at-most-once delivery on network retries.