Dodo Payments Sync Engine

0.4.0 · active · verified Wed Apr 22

DodoSync is a JavaScript/TypeScript library and CLI tool designed to synchronize Dodo Payments data with various SQL and NoSQL databases. It currently supports MongoDB, PostgreSQL, MySQL, and ClickHouse, with plans to expand to Snowflake and other databases, as well as ETL/realtime sync pipelines. The current stable version is 0.4.0, with minor releases adding new database support and features like rate limiting. Releases appear to be driven by feature additions rather than a strict time-based cadence. It offers both a command-line interface for quick setup and programmatic usage for integration into larger applications, providing flexibility for developers to manage payment data locally. Key differentiators include its multi-database support and the ability to define specific data scopes for synchronization.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates programmatic usage of DodoSync to automatically synchronize Dodo Payments data with a MongoDB database at a specified interval.

import { DodoSync } from 'dodo-sync';

const syncDodoPayments = new DodoSync({
    interval: 60, // Sync every 60 seconds
    database: 'mongodb',
    databaseURI: process.env.MONGODB_URI ?? 'mongodb://localhost:27017/dodo',
    scopes: ['licences', 'payments', 'customers', 'subscriptions'],
    dodoPaymentsOptions: {
        bearerToken: process.env.DODO_PAYMENTS_API_KEY ?? 'dp_test_someapikey',
        environment: 'test_mode' // or 'live_mode'
    }
});

// Initialize connection
await syncDodoPayments.init();

// Start the sync loop
syncDodoPayments.start();

console.log('DodoSync started. Data will be synchronized every 60 seconds.');

view raw JSON →