Build
SDK
The TypeScript SDK is @metera/sdk, published at 0.6.0.
import { Metera, MeteraError } from '@metera/sdk';
const metera = new Metera('mk_live_YOUR_KEY', { baseUrl: 'https://api.metera.xyz' });
// natural language -> verified datum
const { data, verification } = await metera.ask('SOL price');
// direct canonical call
const r = await metera.getData('social.value', { handle: 'charlidamelio' });
// the servable catalog
const types = await metera.listTypes();
// errors are typed, never a fabricated value
try {
await metera.ask('SOL price');
} catch (e) {
if (e instanceof MeteraError) console.log(e.code); // INVALID_KEY | INSUFFICIENT_CREDITS | ...
}Test mode: initialise with an mk_test_ key and every call returns a fixture with the same shape and verification.test: true. No source is called and nothing is charged.