Implementation: npm package के माध्यम से उपलब्ध | Source Code: GitHub
आप क्या-क्या Sync कर सकते हैं?
हमारा database sync feature निम्नलिखित Dodo Payments entities को आपके database के साथ synchronize करने का support करता है:Payments
सभी payment transactions को sync करें, जिनमें one-time payments, refunds और payment status updates शामिल हैं।
Customers
अपने customer data को sync में रखें, जिसमें customer profiles, contact information और metadata शामिल हैं।
Subscriptions
subscription data को synchronize करें, जिसमें active subscriptions, billing cycles और subscription status changes शामिल हैं।
Licenses
license information को sync करें, जिसमें license keys, activations और license status updates शामिल हैं।
scopes parameter में निर्दिष्ट करके sync कर सकते हैं। सभी sync operations incremental होते हैं और बेहतर performance के लिए केवल नए या updated records transfer करते हैं।
Database Support
हम वर्तमान में MongoDB, PostgreSQL, MySQL, और ClickHouse को support करते हैं। हम निम्नलिखित के लिए support बढ़ाने पर सक्रिय रूप से काम कर रहे हैं:- Databases: Snowflake और अन्य।
- Pipelines: ETL pipelines, Realtime sync।
शुरुआत करना
आप हमारे database sync feature का उपयोग CLI के माध्यम से या अपने code में programmatically कर सकते हैं। दोनों methods समान functionality प्रदान करते हैं—वह method चुनें जो आपके workflow के लिए सबसे उपयुक्त हो।CLI का उपयोग करना
CLI tool database synchronization को set up और run करने का एक तेज़ तरीका प्रदान करता है। इसे globally install करें, ताकि आप इसे अपने terminal में कहीं से भी उपयोग कर सकें:CLI चलाना
CLI दो modes support करता है: guided setup के लिए Interactive Mode, और direct configuration के लिए Manual Mode। Interactive Mode: Interactive setup wizard शुरू करने के लिए बिना arguments के command चलाएँ।CLI Arguments
number
Seconds में sync interval। यह निर्धारित करता है कि sync operation कितनी बार run होगा। यदि प्रदान नहीं किया गया, तो sync एक बार run होकर exit हो जाएगा।
string
आवश्यक
उपयोग किया जाने वाला database type। Supported values:
"mongodb", "postgres", "mysql", या "clickhouse"।string
आवश्यक
आपके database के लिए Connection URI:
- MongoDB:
mongodb://localhost:27017याmongodb+srv://user:pass@cluster.mongodb.net/ - PostgreSQL:
postgresql://user:password@localhost:5432/mydb - MySQL:
mysql://user:password@localhost:3306/mydb - ClickHouse:
http://localhost:8123
string
आवश्यक
Sync की जाने वाली data entities की comma-separated list। उपलब्ध scopes:
licences, payments, customers, subscriptions। उदाहरण: "payments,customers"।string
आवश्यक
आपकी Dodo Payments API key। Live mode के लिए इसकी शुरुआत
dp_live_ से और test mode के लिए dp_test_ से होनी चाहिए।string
आवश्यक
Environment target। यह या तो
"live_mode" या "test_mode" होना चाहिए। यह निर्धारित करता है कि किस Dodo Payments environment से sync करना है।number
Requests per second में rate limit। यह नियंत्रित करता है कि sync engine API requests कितनी तेज़ी से करता है, ताकि Dodo Payments API पर अत्यधिक load न पड़े।
अपने Code में उपयोग करना
Programmatic control के लिए sync feature को सीधे अपने application में integrate करें। इसे अपने project में dependency के रूप में install करें:Automatic Sync (Interval-based)
जब आप sync को नियमित intervals पर लगातार run करना चाहते हैं, तब automatic sync का उपयोग करें:Manual Sync
जब आप sync operations को on-demand trigger करना चाहते हैं, तब manual sync का उपयोग करें (जैसे, cron job या API endpoint से):PostgreSQL Example
PostgreSQL के साथdodo-sync का उपयोग इस प्रकार करें:
MySQL Example
MySQL के साथdodo-sync का उपयोग इस प्रकार करें:
ClickHouse Example
ClickHouse के साथdodo-sync का उपयोग इस प्रकार करें:
Constructor Options
string
आवश्यक
उपयोग किया जाने वाला database का नाम। Supported values:
"mongodb", "postgres", "mysql", या "clickhouse"।string
आवश्यक
आपके database के लिए Connection string:
- MongoDB:
mongodb://localhost:27017याmongodb+srv://... - PostgreSQL:
postgresql://user:password@localhost:5432/mydb - MySQL:
mysql://user:password@localhost:3306/mydb - ClickHouse:
http://localhost:8123
string[]
आवश्यक
Sync की जाने वाली entities का array। उपलब्ध options:
"licences", "payments", "customers", "subscriptions"। आप इनमें से कोई भी combination शामिल कर सकते हैं।object
आवश्यक
Authentication और environment selection के लिए Dodo Payments API configuration। Complete options के लिए TypeScript SDK types देखें।Required properties:
bearerToken: आपकी Dodo Payments API keyenvironment:"test_mode"या"live_mode"
number
Automatic syncs के बीच seconds में समय।
.start() के साथ automatic syncing करते समय आवश्यक। .run() के साथ manual syncing करते समय optional।number
Requests per second की संख्या। यह नियंत्रित करता है कि sync engine API requests कितनी तेज़ी से करता है, ताकि Dodo Payments API पर अत्यधिक load न पड़े।
महत्वपूर्ण जानकारी
Sync engine changes को track करता है और केवल नए या updated records को sync करता है, जिससे बड़े datasets के साथ भी subsequent syncs efficient रहते हैं।
अतिरिक्त Resources
GitHub Repository
Source code देखें, issues report करें या improvements contribute करें
npm Package
Package details और installation instructions देखें