SMS OTP
SMS से कोड भेजें. recipient के आधार पर जाँचें.
SMS verification sends a one-time code to a phone number and confirms the person typing it back holds the line. Bird generates the code, sends it, enforces per-recipient caps, and checks it by recipient, so there's no id to store and no resend endpoint to wire.
import { BirdClient } from "@messagebird/sdk";
const bird = new BirdClient({
apiKey: process.env.BIRD_API_KEY!,
});
// Send the code, then check it by recipient.
await bird.verify.verifications.create({
to: { phone_number: "+15551234567" },
}).safe();
const { data, error } = await bird.verify.verifications.check({
to: { phone_number: "+15551234567" },
code: userInput,
}).safe();
if (error) throw error;
SMS OTP भेजने के लिए एक कॉल और जाँचने के लिए एक कॉल है।
SMS is a phone-family channel on the Bird Verify API: post a verification with a phone number and we send the code on a Bird-managed shared sender, Bird Verify by default or Authifly if you prefer it; check it by that same number. Re-posting the create is the resend (create-or-retry), and every code in the session stays valid until it verifies, expires, or runs out of attempts.
SMS verification पर आपको क्या मिलता है।
हर सेंड में बिल्ट-इन।
- 01
फ़ोन नंबर से संबोधित।
एक अकेला E.164 फ़ोन नंबर पास करें। हम इसे नॉर्मलाइज़ करते हैं और उसके देश के लिए रिज़ॉल्व किए गए sender पर SMS से भेजते हैं।
- 02
सर्वर-जनरेटेड, हैश किए गए कोड।
डिफ़ॉल्ट रूप से 6-अंकों का कोड (4–10 कॉन्फ़िगर करने योग्य), जो एक क्रिप्टोग्राफ़िक रैंडम स्रोत से जनरेट होता है और सिर्फ़ HMAC के रूप में स्टोर होता है। आप कभी प्लेनटेक्स्ट नहीं देखते।
- 03
Resend वही कॉल है।
Re-post the create to resend once the 60-second cooldown passes: same session, new code, both still valid. No separate resend endpoint.
- 04
प्रति-recipient सीमाएँ शामिल।
एक प्रति-recipient सेंड कैप सेंड वॉल्यूम और बेकाबू खर्च को सीमित करता है, Retry-After के साथ 429 है।
- 05
पहुँच जो देश के हिसाब से बढ़ती है।
SMS sends on a Bird-managed shared sender today, Bird Verify or Authifly, showing a branded sender ID where a country permits one and a short code or local number where one is required, with dedicated and registered senders extending reach as they land.
पूरा फ़्लो, दो कॉल।
Create-or-retry sends the code to the phone number; check confirms it by that number. There's no id to thread between the two: the recipient is the key.
await bird.verify.verifications.create({
to: { phone_number: "+15551234567" },
}).safe();
const { data, error } = await bird.verify.verifications.check({
to: { phone_number: "+15551234567" },
code: userInput,
}).safe();
if (error) throw error;
// data.success is true or false; data.reason elaborates ("incorrect_code", "expired", "attempts_exhausted")बाकी Verify प्लेटफ़ॉर्म
एक API, कीज़ का एक सेट। बाकी क्षमताओं को एक्सप्लोर करें।
वह verification API जिसमें स्टोर करने के लिए कुछ नहीं।
SMS is one channel of Bird Verify: email and WhatsApp ship with it, and voice is rolling out, all on the same two endpoints.