Install
The one pattern to learn
await createDBDock()— initializes DBDock (readsdbdock.config.jsonand env vars)dbdock.get(ServiceClass)— fetches the service you need- Call methods on the service
Available services
BackupService
Create backups, list backups, get metadata.
StorageService
Direct access to the storage adapter (advanced).
CryptoService
Encrypt/decrypt arbitrary data (advanced).
AlertService
Send notifications programmatically.
TypeScript support
DBDock ships full type definitions. In TypeScript:Configuration
The SDK reads from the same sources as the CLI:dbdock.config.json(path controlled byDBDOCK_CONFIG_PATH)- Environment variables (
.envand.env.local) - Environment-only if no config file exists
Lifecycle
createDBDock() returns a context. Internally it holds connections and caches. If you’re running a long-lived process, create it once and reuse it:
What’s supported programmatically
Restore and delete programmatic APIs are planned — follow dbdock/dbdock#issues for updates.
See also
Creating backups
Full API for
BackupService.createBackup().Listing backups
Query the backup history.
Scheduling
Build a scheduler with
node-cron.Alerts
Use the alert system from code.

