Skip to main content

SDKs

Official client libraries for the Filedgr API are coming soon. Until they land, you can integrate against the REST API directly — it is plain JSON over HTTPS with two auth headers, so any HTTP client will do, and the wrappers below are usually all you need.

Available today

@filedgr/filedgr-template-sdk

A TypeScript library for reading Filedgr-attested data from inside a digital-twin template. It is what a template uses to render the vault it belongs to — not a client for the partner API.

npm install @filedgr/filedgr-template-sdk

Calling the API without an SDK

Every request carries the same two headers, so a thin wrapper is usually all you need.

export FILEDGR_API="https://api.filedgr.network"

curl "$FILEDGR_API/vaults" \
-H "x-api-key: $FILEDGR_API_KEY" \
-H "x-api-secret: $FILEDGR_API_SECRET"
import os, requests

BASE = "https://api.filedgr.network"
HEADERS = {
"x-api-key": os.environ["FILEDGR_API_KEY"],
"x-api-secret": os.environ["FILEDGR_API_SECRET"],
}

resp = requests.get(f"{BASE}/vaults", headers=HEADERS, timeout=30)
# An empty list is 204 with no body, not an empty array.
vaults = [] if resp.status_code == 204 else resp.json()["content"]
const BASE = 'https://api.filedgr.network';

async function filedgr(path, options = {}) {
const res = await fetch(`${BASE}${path}`, {
...options,
headers: {
'x-api-key': process.env.FILEDGR_API_KEY,
'x-api-secret': process.env.FILEDGR_API_SECRET,
'Content-Type': 'application/json',
...options.headers,
},
});
if (res.status === 204) return null;
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
return res.json();
}

Read Conventions before you write client code — the 204-on-empty rule and the pagination envelope are the two things that most often catch people out.

Next steps