Varve Agency SDKs
Technical documentation for isomorphic, Zod-validated TypeScript clients interacting with government and institutional statistical APIs.
Installation
npm install @varve/statcan-wds @varve/statcan-rdaas @varve/ons-api @varve/boc-valet zodNote: zod is a required peer dependency for runtime validation.
Available Packages
Statistics Canada
Time series vectors, table metadata, and release monitoring. Full coverage of all 16 WDS endpoints with automated 409/500 retry handling.
Statistics Canada
Industry and occupation classifications, hierarchical code trees, plain-English index search, and version concordances.
Canada Mortgage and Housing Corporation
Housing market CSV exports, bundled portal table metadata, filter validation, and normalized observation rows.
Bank of Canada
Financial time series, exchange rates, series and group discovery, recent observations, and graph-ready metadata.
UK Office for National Statistics
Economic and demographic timeseries by CDID, dataset topic navigation, observation querying, and filtered CSV/XLS data extracts.
Eurostat
JSON-stat data, SDMX metadata and CSV access, dataset catalogues, and graph-ready dimension/member metadata.
World Bank
Countries, indicators, sources, topics, observations, pagination helpers, and indicator graph metadata.
Architecture & Design
Runtime Validation
All external API responses are parsed through Zod schemas. Upstream contract violations or structural anomalies throw structured errors immediately rather than corrupting application state.
Isomorphic Implementation
Clients rely exclusively on the standard Fetch API without Node.js-specific dependencies. Supported across Node.js 18+, modern browsers, and edge runtimes (e.g., Cloudflare Workers).
Network Resilience
Built-in retry mechanisms with exponential backoff. Automatically handles transient 409/429/500 HTTP statuses, transparently respecting Retry-After headers.
Build Optimization
Distributed as dual ESM/CJS bundles. Explicitly marked as side-effect free (sideEffects: false) to ensure comprehensive tree-shaking in modern bundlers.