Registry / payments / dodo-sync

dodo-sync

JSON →
library0.4.0jsnpmunverified

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-sync
INSTALL
IMPORT
SIG · DODO-SYNC
D
dodo-sync
paymentsjavascriptv0.4.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DodoSync
import { DodoSync } from 'dodo-sync';
const DodoSync = require('dodo-sync');
The library primarily uses named exports and is designed for ESM. CommonJS `require` might lead to issues or require accessing a `.default` property if transpiled.
DodoSync (CLI)
dodo-sync --database mongodb --database-uri ... --api-key ... --scopes ...
node dodo-sync.js
The CLI is installed globally and invoked directly as `dodo-sync`. Do not try to run an internal script directly.
DodoPaymentsOptions
import type { DodoPaymentsOptions } from 'dodo-sync';
import { DodoPaymentsOptions } from 'dodo-sync';
Import types using `import type` to avoid bundling unnecessary runtime code and for clearer intent.

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.');
dodo-sync --version
Debug
Known issues
gotchaCLI arguments (`--api-key`) and programmatic options (`bearerToken`) for the Dodo Payments API key use different naming conventions. Ensure you use the correct key name for your chosen method of integration.
fix
For CLI, use `--api-key`. For programmatic usage, pass the key as `dodoPaymentsOptions: { bearerToken: 'YOUR_KEY' }`.
affects: >=0.1.0
gotchaThis library is in its early stages (v0.4.0) and while features are being added, the API might evolve in future minor or major versions. Review changelogs carefully during upgrades.
fix
Subscribe to release notes and thoroughly test integrations when upgrading to new minor or major versions to detect any subtle API changes.
affects: >=0.1.0
gotchaDatabase connection URIs are highly specific to the database type (MongoDB, PostgreSQL, MySQL, ClickHouse). Providing an incorrect or malformed URI will prevent the sync engine from connecting.
fix
Consult your database documentation for the correct connection string format. Examples are provided in the dodo-sync README for each supported database type.
affects: >=0.1.0
gotchaThe `--scopes` CLI argument and `scopes` programmatic option require a comma-separated string (CLI) or an array of strings (programmatic) representing valid Dodo Payments data entities (e.g., 'payments', 'customers'). Invalid or misspelled scopes will result in no data synchronization for those entities.
fix
Refer to Dodo Payments documentation for a definitive list of available data scopes and ensure exact matches.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Missing required argument: --database
The `--database` argument was not provided when running the CLI.
fix
Add the `--database` argument with a supported type, e.g., `--database mongodb`.
Error: `database` option is required.
The `database` property was omitted from the `DodoSync` constructor options.
fix
Include `database: 'mongodb'` (or 'postgres', 'mysql', 'clickhouse') in the DodoSync constructor options.
Error: Failed to connect to database at mongodb://localhost:27017. Reason: Authentication failed.
Incorrect database URI, credentials, or network configuration preventing a successful database connection.
fix
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.
TypeError: DodoSync is not a constructor
Attempting to import `DodoSync` using a CommonJS `require` statement or an incorrect ESM default import.
fix
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()`.
Upgrade
Version history
0.4.0latest on npm
Audit
Dependencies
typescriptrequiredPeer dependency for type checking and compilation, indicating strong TypeScript support.
Agent activity
40 hits · last 30 days
node
38
Resources
dodo-sync — npm install dodo-sync · libregistry