SDK
Web3Fire SDK
Typed client for entities, search, and compare. No runtime dependencies.
Yükle
Not yet published to npm — install from this repository:
npm install ./sdk
# or copy the single-file build:
# sdk/dist/index.mjs (+ sdk/dist/index.d.ts for TypeScript)Hızlı Başlangıç
import { Web3Fire } from '@web3fire/sdk';
// anonymous (public API)
const w3f = new Web3Fire();
// with an API key (higher limits + usage dashboard)
// const w3f = new Web3Fire({ apiKey: 'pk_live_...' });
const eth = await w3f.getEntity('ethereum');
console.log(eth.summary);
const trust = await w3f.getEntity('ethereum', { fields: ['summary', 'trust'] });
const results = await w3f.search('stablecoin', { limit: 10 });
const cmp = await w3f.compare('ethereum-vs-bitcoin');Methods
getEntity(slug, { fields?, lang? })identity · summary · score · relations · compare · sources · timeline · faq · evidence · trust · freshness
search(q, { lang?, limit? })FTS5 with alias + intent routing
compare(slug, { lang? })dimension-by-dimension comparison values
Errors throw with .message = error code and .status = HTTP status. 429/5xx are retried with backoff.