Skip to main content

Built and signed on GitHub Actions

Works with
This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score70%
License
MIT
Downloads25/wk
Published2 weeks ago (0.1.0)

🔵 Worlds is the infrastructure layer for knowledge.

@worlds/client

TypeScript client for the Worlds data-plane API at worlds-api.wazoo.dev.

This package is generated from the canonical Worlds API OpenAPI document (committed in openapi/openapi.json). Use it for data-plane operations against a hosted or self-hosted Worlds service: world search, SPARQL, import, export, reindex, world lifecycle, and data-plane API keys.

For the embeddable SDK (in-process graph operations over any backend), use @worlds/sdk. For platform management-plane operations (users, usage, limits, billing) use @wazoo/client.

Install

npx jsr add @worlds/client

Usage

import { createClient, searchWorld } from "@worlds/client";

const client = createClient({
  baseUrl: "https://worlds-api.wazoo.dev",
  auth: process.env.WORLDS_DATA_PLANE_TOKEN,
});

const response = await searchWorld({
  client,
  path: { id: "w_<world-uid>" },
  body: { query: "explores" },
});

console.log(response.data?.results);

Development

Requires Deno (version pinned in .tool-versions).

deno task ci

Run deno task sync:openapi to refresh openapi/openapi.json. By default it reads the checked-in snapshot at ../worlds-api/openapi/openapi.json (a sibling checkout of the Worlds API repo). Set WORLDS_API_OPENAPI_URL=https://worlds-api.wazoo.dev/openapi.json to sync from a deployed API. CI runs deno task openapi:check so spec drift fails the build.

Run deno task generate to regenerate src/generated/ from the synced spec via @hey-api/openapi-ts.

Built and signed on
GitHub Actions

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@worlds/client

Import symbol

import * as client from "@worlds/client";
or

Import directly with a jsr specifier

import * as client from "jsr:@worlds/client@^0.1.0";