@onesi/genesis
v0.2.15
Published
One typed SDK for every Genesis service (Foundry, Hives, Relays, IAM...) via the Genesis API gateway
Maintainers
Readme
@onesi/genesis
The TypeScript SDK for OneOS. One typed client for every Genesis service, through the Genesis API at https://os.one.ml/api.
npm install @onesi/[email protected]import { Genesis, GenesisError } from '@onesi/genesis';
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY });
try {
const projects = await genesis.hives.projects.list();
} catch (e) {
if (e instanceof GenesisError) console.error(e.status, e.code, e.requestId, e.message);
}- Credentials: create an organization API key in the Console at https://os.one.ml (API keys → Create) and pass it as
apiKeyorGENESIS_API_KEY. A WorkOS M2M or session token goes intoken/GENESIS_TOKEN. - Gateway: defaults to
https://os.one.ml/api;https://console.life.one/apiis an alias. Override withbaseUrlorGENESIS_BASE_URL. Onlyhttps://(orhttp://on loopback) is accepted. - Every operation:
genesis.call(operationId, input)reaches any operation in the bundled OpenAPI document (@onesi/genesis/spec.json).operationTablelists them. - Live service state:
GET /v1/status(orgenesis statusin the CLI). - Errors: every failure is a
GenesisErrorwithstatus,code,requestIdand a message from the gateway's error catalog.errorCatalog(e)addsrequired_scopeanddocs_url. - Runtime: ESM only, Node.js 20.19 or later.
Use the same version of the SDK, @onesi/genesis-cli and @onesi/genesis-mcp.
Docs: https://os.one.ml/docs · API reference: https://os.one.ml/api/v1/openapi.json · Error codes: https://os.one.ml/api/v1/errors
