Channel orchestration
प्रीव्यू मेंहमारे डिफ़ॉल्ट से शुरू करें. सिर्फ़ उतना ही override करें जितनी ज़रूरत हो.
Channel उपलब्धता, sender नियम, और नियम-कानून हर देश में अलग होते हैं, और उन्हें सही करना वर्षों का काम है। Bird इसे प्रति-देश base कॉन्फ़िगरेशन के रूप में देता है: कौन-से channel कहाँ पहुँचते हैं, कौन-से sender की अनुमति है, और समझदार code डिफ़ॉल्ट। आपकी सेटिंग्स इसके ऊपर layer होती हैं। आप एक देश के लिए एक चीज़ बदलते हैं; जिसे आप नहीं छूते वह नीचे वाले layer तक fall through हो जाता है। यही है प्रति-देश रूटिंग एक फ़र्स्ट-क्लास API resource के रूप में — वह नियंत्रण जो ज़्यादातर verification API नहीं देते।
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 } = await bird.verify.verifications.check({
to: { phone_number: "+15551234567" },
code: userInput,
}).safe();
आप Bird के डिफ़ॉल्ट inherit करते हैं, फिर उन पर आगे बनाते हैं।
Every verification on the Bird Verify API resolves its settings through a cascade. At the bottom is a per-country base Bird maintains from years of running email and SMS, so before you configure anything, a verification already routes sensibly in every country. Your configuration and per-country overrides layer on top, and a per-request option can tune a single call. You're never starting from a blank slate, and you only own the decisions you actually want to make.
value cascade।
सबसे ऊपर वाला tier जो कोई value सेट करता है वह जीतता है; जो कुछ आप unset छोड़ते हैं वह नीचे वाले tier तक fall through हो जाता है।
- 01
प्रति-request options।
create call पर मौजूद fields (code length, channel preference, locale) उस एक verification के लिए जीतते हैं। सबसे हल्का, सबसे लोकल override।
- 02
आपके प्रति-देश overrides।
एक देश के लिए channel क्रम या sender बदलें। एक override merge होता है: यह सिर्फ़ उन fields को छूता है जो आप सेट करते हैं, और उस देश का बाकी हिस्सा अब भी नीचे से inherit करता है।
- 03
आपके कॉन्फ़िगरेशन डिफ़ॉल्ट।
Your app-wide plan and code rules: the channel order, code length, TTL, and attempts you want everywhere you haven't set a country override.
- 04
Bird का प्रति-देश base।
सबसे निचला layer: Bird के अपने प्रति-देश डिफ़ॉल्ट, जो email और SMS को बड़े पैमाने पर चलाने के अनुभव से लिए गए हैं। जो कुछ आप unset छोड़ते हैं वह इस तक fall through हो जाता है, इसलिए एक verification हमेशा एक समझदार plan में resolve होता है।
एक देश override करें, बाकी inherit करें।
अपना plan एक बार सेट करें, फिर सिर्फ़ उन्हीं देशों को छुएँ जिन्हें कुछ अलग चाहिए। यहाँ Brazil पहले WhatsApp से शुरू होता है, फिर SMS; बाकी हर देश आपके डिफ़ॉल्ट और Bird के base तक fall through होता रहता है।
// Your app-wide default plan.
await bird.verify.verifications.configurations.update("vfc_login", {
channels: [
{ channel: "email", state: "enabled" },
{ channel: "sms", state: "enabled" },
],
}).safe();
// Override one country; the rest inherits.
await bird.verify.verifications.configurations.countries.upsert("vfc_login", "BR", {
channels: [
{ channel: "whatsapp", state: "enabled" },
{ channel: "sms", state: "enabled" },
],
}).safe();
एक verification किसमें resolve होता है।
इस कॉन्फ़िगरेशन के तहत एक ब्राज़ीली नंबर cascade के ज़रिए resolve होता है। BR override पहले WhatsApp फिर SMS का क्रम तय करता है, दोनों उपलब्ध हैं, और verification उस क्रमबद्ध plan की रिपोर्ट करता है जिसे वह उपयोग करेगा, अपनी typed vrf_ id के साथ।
const { data } = await bird.verify.verifications.create({
configuration_id: "vfc_login",
to: { phone_number: "+5511998765432" }, // Brazil
}).safe();
// Resolved through the cascade + availability/kill-switch ceilings:
// {
// id: "vrf_01k2m9q8e7fh3v0b7m4d2a9xzt",
// status: "pending",
// channels: [{ channel: "whatsapp" }, { channel: "sms" }],
// last_channel: "whatsapp"
// }
cascade के ऊपर दो सीलिंग बैठती हैं।
The cascade decides defaults. Two gates decide what's allowed. They cap the resolved plan rather than supplying values that fall through:
Per-country availability. You can only enable channels Bird actually offers in a country. Enabling one we don't support there is a no-op, not a silent failure: availability is an intersection, never an override.
ग्लोबल kill-switch. जब किसी provider के साथ कोई incident होता है, तो Bird एक channel को हर जगह एक साथ खींच सकता है। आपका कॉन्फ़िगरेशन नहीं छुआ जाता; resolved plan बस अगले channel पर fall back हो जाता है, फिर switch साफ़ होने पर बहाल हो जाता है।
रूटिंग जो आप सेट करते हैं, कोई ticket नहीं जो आप फ़ाइल करते हैं।
हर verification के लिए resolved, response पर लौटाया गया।
- 01
प्रति-देश रूट, नंबर के हिसाब से।
The country is derived from the recipient's E.164 number. You don't pass it. Set a route for a country and it overrides the order and senders there.
- 02
channel चालू और बंद करें।
हर channel अपने साथ एक enable/disable स्टेट रखता है, इसलिए आप किसी देश के लिए एक को बंद कर सकते हैं बिना plan में उसकी जगह खोए।
- 03
resolved plan response पर होता है।
हर verification उन क्रमबद्ध channels की रिपोर्ट करता है जिनमें वह resolve हुआ, इसलिए cascade ने जो तय किया वह कभी रहस्य नहीं रहता।
- 04
Automatic failover रोल आउट हो रहा है।
plan के ज़रिए delivery-आधारित आगे बढ़ना (जब एक channel न पहुँचे तो अगला आज़माना) delivery status आने के साथ रोल आउट हो रहा है। plan आज ही resolve होकर लौटाया जाता है।
Channel orchestration FAQ
कॉन्फ़िगरेशन cascade क्या है?
Bird का प्रति-देश base मुझे क्या देता है?
क्या एक प्रति-देश override पूरा plan बदल देता है?
क्या मैं ऐसा channel enable कर सकता हूँ जो Bird किसी देश में ऑफ़र नहीं करता?
देश कैसे तय होता है?
मेरे यूज़र code किससे आया देखते हैं?
बाकी Verify प्लेटफ़ॉर्म
एक API, keys का एक सेट। बाकी क्षमताओं को एक्सप्लोर करें।
वह प्रति-देश नियंत्रण जो कोई और verification API नहीं देता।
Orchestration, Bird Verify की एक क्षमता है: channel, code, और limits इसके साथ आते हैं, उन्हीं दो endpoints पर।