Getting Started
Install a Varve agency SDK, create a client, make a request, and handle verified responses.
Prerequisites
- Node.js 18 or later, or any runtime with the standard
fetchAPI - TypeScript recommended
zodinstalled as a peer dependency
Install one package
Each SDK is independent. Install the provider you need:
Install more than one when your application crosses sources:
Make a first request
This example fetches the latest 12 observations for a Statistics Canada vector.
If the response returns, it has passed the SDK's Zod validation boundary.
Choose the right client
Not sure which package you need? Use Choosing a Provider.
Common starting points:
| Goal | Package |
|---|---|
| Canadian table data or vectors | @varve/statcan-wds |
| Canadian classification codes | @varve/statcan-rdaas |
| UK CDID time series | @varve/ons-api |
| EU SDMX or JSON-stat data | @varve/eurostat-api |
| BIS SDMX financial and banking statistics | @varve/bis-stats-api |
| Country-year development indicators | @varve/worldbank-api |
| Canadian housing portal exports | @varve/cmhc-api |
| Bank of Canada financial series | @varve/boc-valet |
| FRED economic series | @varve/fred-api |
Configuration
Clients accept small configuration objects. The most common options are baseUrl, maxRetries, and, where supported, timeoutMs.
Providers that require credentials expose explicit configuration. FRED requires an API key:
Keep API keys on the server. For browser apps, proxy keyed requests through your backend.
Handle errors
Every package exports typed errors for failed requests. Error objects include enough context to debug the upstream call.
Some packages expose more specific errors for known provider behavior. For example, @varve/statcan-wds separates invalid coordinates, suppressed data, agency internal failures, and malformed responses.