An Effect-native TypeScript SDK for the CREA DDF API (Canadian Real Estate Association's Data Distribution Facility). Provides two consumption paths: direct API calls against the live OData endpoint, and a database-first approach that syncs listings, members, offices, and open houses into PostgreSQL via Drizzle ORM. The sync saves watermarks for incremental updates and supports telemetry via OpenTelemetry. Version 0.0.6 requires Effect 4.0.0-beta.71 and Node.js >=24.14.0 or Bun >=1.3.0. Ships TypeScript types and is ESM-only. Differentiators include full integration with Effect's structured concurrency, Drizzle for type-safe queries, and a frontend-ready database client that avoids exposing CREA credentials.
npm install crea-ddfNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Queries synced database using DdfDbClient with filters, includes, and pagination. Requires DATABASE_URL in environment.
Upgrade Node.js to version 24.14.0 or later, or use Bun 1.3.0+.
Pin effect and @effect/sql-pg to exact versions. Use bun update with --exact or lockfile.
Use syncDdfDatabaseOnce and DdfDbClient instead of direct listProperties calls.
Ensure listings are synced before open houses, or adjust the date window via configuration.
Create the layer with DdfDbClient.layer and Layer.provide(DdfDatabase.layerConfig) before use.
Use import { DdfDbClient } from 'crea-ddf/db' (lowercase 'db'). Ensure tsconfig.json has moduleResolution: 'bundler' or 'node16'.Use `import` statements. If you must use CJS, set `"type": "module"` in your package.json or use dynamic import().
Wrap the usage in `Effect.provide(dbReadLayer)` where dbReadLayer includes DdfDbClient.layer and DdfDatabase.layerConfig.