Installation¶
Postgres Conductor is available on npm:
@opentelemetry/api is a required peer dependency. Without a registered OpenTelemetry SDK, tracing is a no-op.
The package is ESM-only and runs on Node.js 22+. It ships its own TypeScript types. CommonJS projects can load it with await import("pgconductor-js").
Database Setup¶
Postgres Conductor manages the pgconductor schema itself. All you have to do is provide a connection string. On startup, it will create the schema and run any migrations if necessary.
const conductor = Conductor.create({
connectionString: "postgres://localhost:5432/mydb"
});
const orchestrator = Orchestrator.create({
conductor,
});
// This will run `ensureInstalled()` during startup
await orchestrator.start();
// Alternatively, call it manually form the conductor
await conductor.ensureInstalled();
![INFO] If this library will ever ship breaking changes to the schema, it will gracefully handle the upgrade via live migrations.
What's Next?¶
Learn how to create your first task.