This is a programmatically-generated client for the EC3 public API based on the openEPD standard. It is based on EC3's OpenAPI spec, and generated using openapi-typescript-codegen.
For example:
import { EC3 } from '@cercula-io/ec3'
import type { EPD_List } from '@cercula-io/ec3'
const client = new EC3({
BASE: 'https://openepd.buildingtransparency.org/api',
TOKEN: process.env.TOKEN,
})
client.epds.getEpds().then((result) => {
console.log((result as EPD_List[]).map((e) => e.product_description))
})
See the /examples
directory for more.
Getting set up:
- Clone the repo
- Run
npm install
to pull dependencies
Iterating:
- Update the OpenAPI spec from https://openepd.buildingtransparency.org/openapi.json and put the contents in
openapi.json
, if desired - Run
npm run gen
to generate new code - Run
npm run build
to transpile the TypeScript code