Key Takeaways
- TypeScript send-OTP uses server-side fetch/undici against POST /messages — not a browser-exposed secret and not an npm SMS SDK product.
- Hash the code in your app; SMS is transport.
- Idempotency-Key = challenge id. Confirm fields in Developer Center.
- You bring Android + operator credit. Platform meters devices + volume.
- Free/Developer pause at the SMS allowance. No Unlimited SMS titles.
TypeScript Android SMS gateway API — send OTP is Node/BFF REST, not a client SDK theatre. OTP use case · Parse DLR. Docs: Developer Center.
Devices and send volume. You fund the SIM.
Idempotency-Key: challenge_…
Same key on retry. New key = second bubble.
TypeScript talks REST
fetch/undici on the server. No “Complete TypeScript SMS SDK” required.
If the API key ships in a Vite bundle, rotate it and move send behind your API.
How to send OTP
- Create challenge + hash.
- POST short SMS body.
- Persist message id.
- Verify in your login UI.
curl -X POST "https://app.sms-gateway.app/api/v1/messages" \
-H "Authorization: Bearer $SMS_GATEWAY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 3f1b0c8a-9d2e-4c77-9f5a-2b6d1e0f4a83" \
-d '{"to":["+14155552671"],"text":"Your verification code is 481920","type":"sms"}'OTP client checklist
| Item | Pass |
|---|---|
| Key location | Server env |
| Idempotency-Key | Challenge id |
| Logging | No OTP digits |
| Resend | Product cooldown — not fetch retry storms |
| Device | Isolate OTP SIM |
fetch sketch
// Server-side sketch — confirm JSON in Developer Center
export async function sendOtpSms(apiKey: string, to: string, text: string, challengeId: string) {
const res = await fetch("https://app.sms-gateway.app/api/v1/messages", {
method: "POST",
headers: {
Authorization: `Bearer ${apiKey}`,
"Content-Type": "application/json",
"Idempotency-Key": challengeId,
},
body: JSON.stringify({ to, text }),
});
if (!res.ok) throw new Error(`send_http_${res.status}`);
return res.json();
}Next steps
Staging canary + webhook assert; then production key. Downloads. Free: 300 SMS lifetime.
Related product pages
Jump to the live product docs for this topic—not another long-form article.
- OTP and 2FA SMS on AndroidAuthentication flows
- SMS API documentationLive endpoint reference
- device and SMS volume pricingPlans and allowances
- Android SMS gateway product guideDefinition, product, and how to buy




