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.
npm install dodo-syncVerified import paths — ran on the pinned version, not inferred.
Demonstrates programmatic usage of DodoSync to automatically synchronize Dodo Payments data with a MongoDB database at a specified interval.
For CLI, use `--api-key`. For programmatic usage, pass the key as `dodoPaymentsOptions: { bearerToken: 'YOUR_KEY' }`.Subscribe to release notes and thoroughly test integrations when upgrading to new minor or major versions to detect any subtle API changes.
Consult your database documentation for the correct connection string format. Examples are provided in the dodo-sync README for each supported database type.
Refer to Dodo Payments documentation for a definitive list of available data scopes and ensure exact matches.
Add the `--database` argument with a supported type, e.g., `--database mongodb`.
Include `database: 'mongodb'` (or 'postgres', 'mysql', 'clickhouse') in the DodoSync constructor options.
Verify the `databaseURI` (CLI) or `databaseURI` option (programmatic) is correct, including hostname, port, user, and password. Ensure the database server is reachable and configured for remote connections if necessary.
Use a named ESM import: `import { DodoSync } from 'dodo-sync';`. If still encountering issues in a CommonJS environment, ensure your project is configured for ESM or use dynamic `import()`.