Files
wehub-resource-sync 426e9eeabd
Benchmark Bridge Tests / benchmark (bunx @biomejs/biome check packages/lifeops-bench/src, benchmark-lint) (push) Waiting to run
Benchmark Bridge Tests / benchmark (bunx vitest run --config packages/lifeops-bench/vitest.config.ts --root packages/lifeops-bench --passWithNoTests, benchmark-tests) (push) Waiting to run
Build Agent Image / build-and-push (push) Waiting to run
Chat shell gestures / Chat shell gesture + parity e2e (push) Waiting to run
ci / test (push) Waiting to run
ci / lint-and-format (push) Waiting to run
ci / build (push) Waiting to run
ci / dev-startup (push) Waiting to run
Cloud Gateway Discord / Test (push) Waiting to run
Cloud Gateway Webhook / Test (push) Waiting to run
Cloud Tests / lint-and-types (push) Waiting to run
Cloud Tests / unit-tests (push) Waiting to run
Cloud Tests / integration-tests (push) Waiting to run
Cloud Tests / e2e-tests (push) Blocked by required conditions
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
Deploy Apps Worker (Product 2) / Determine environment (push) Waiting to run
Deploy Apps Worker (Product 2) / Deploy apps worker to apps-control host (${{ needs.determine-env.outputs.environment }}) (push) Blocked by required conditions
Deploy Eliza Provisioning Worker / Determine environment (push) Waiting to run
Deploy Eliza Provisioning Worker / Deploy worker to Hetzner host (${{ needs.determine-env.outputs.environment }} @ ${{ needs.determine-env.outputs.deployment_sha }}) (push) Blocked by required conditions
Dev Smoke / Classify changed paths (push) Waiting to run
Dev Smoke / bun run dev onboarding chat (push) Blocked by required conditions
Dev Smoke / Vite HMR dependency-level smoke (push) Blocked by required conditions
Electrobun Submodule Guard / electrobun gitlink is fetchable (push) Waiting to run
gitleaks / gitleaks (push) Waiting to run
Markdown Links / Relative Markdown Links (push) Waiting to run
Publish @elizaos/example-code / check_npm (push) Waiting to run
Publish @elizaos/example-code / publish_npm (push) Blocked by required conditions
Publish @elizaos/plugin-elizacloud / verify_version (push) Waiting to run
Publish @elizaos/plugin-elizacloud / publish_npm (push) Blocked by required conditions
Quality (Extended) / Homepage Build (PR smoke) (push) Waiting to run
Quality (Extended) / Comment-only diff guard (push) Waiting to run
Quality (Extended) / Format + Type Safety Ratchet (push) Waiting to run
Quality (Extended) / Develop Gate (secret scan + UI determinism) (push) Waiting to run
Quality (Extended) / Develop Gate (lint) (push) Waiting to run
Sandbox Live Smoke / Sandbox live smoke (push) Waiting to run
Snap Build & Test / Build Snap (amd64) (push) Waiting to run
Snap Build & Test / Build Snap (arm64) (push) Waiting to run
supply-chain / sbom (push) Waiting to run
supply-chain / vulnerability-scan (push) Waiting to run
Build, Push & Deploy to Phala Cloud / build-and-push (push) Waiting to run
Test Packaging / Validate Packaging Configs (push) Waiting to run
Test Packaging / PyPI on Python ${{ matrix.python }} (push) Waiting to run
Test Packaging / Pack & Test JS Tarballs (push) Waiting to run
Test Packaging / elizaos CLI global-install smoke (node + bun) (push) Waiting to run
UI Fixture E2E / ui-fixture-e2e (push) Waiting to run
UI Fixture E2E / fixture-e2e (push) Waiting to run
UI Story Gate / story-gate (push) Waiting to run
vault-ci / test (macos-latest) (push) Waiting to run
vault-ci / test (ubuntu-latest) (push) Waiting to run
vault-ci / test (windows-latest) (push) Waiting to run
vault-ci / app-core wiring tests (push) Waiting to run
verify-patches / verify patches/CHECKSUMS.sha256 (push) Waiting to run
Voice Benchmark Smoke / voice-emotion fixture smoke (push) Waiting to run
Voice Benchmark Smoke / voiceagentbench fixture smoke (push) Waiting to run
Voice Benchmark Smoke / voicebench-quality unit smoke (push) Waiting to run
Voice Benchmark Smoke / voicebench TypeScript unit (no audio) (push) Waiting to run
Voice Benchmark Smoke / voice bench smoke summary (push) Blocked by required conditions
Windows CI / windows ([bun run --cwd packages/app-core test bun run --cwd packages/elizaos test bun run --cwd packages/cloud/shared test], app-and-cli) (push) Waiting to run
Windows CI / windows ([bun run --cwd packages/scenario-runner test bun run --cwd packages/vault test bun run --cwd packages/security test bun run --cwd plugins/plugin-coding-tools test], framework-packages) (push) Waiting to run
Windows CI / windows ([bun run --cwd plugins/plugin-elizacloud test bun run --cwd plugins/plugin-discord test bun run --cwd plugins/plugin-anthropic test bun run --cwd plugins/plugin-openai test bun run --cwd plugins/plugin-app-control test bun run --cwd plugins/pl… (push) Waiting to run
Windows CI / windows ([node packages/scripts/run-turbo.mjs run build --filter=@elizaos/core --filter=@elizaos/shared --filter=@elizaos/agent --concurrency=4 node packages/scripts/run-bash-linux-only.mjs scripts/verify-riscv64-buildpaths.sh node packages/scripts/run… (push) Waiting to run
Windows CI / windows ([node packages/scripts/run-turbo.mjs run typecheck --filter=@elizaos/core --filter=@elizaos/shared --filter=@elizaos/cloud-shared --concurrency=4 bun run --cwd packages/core test bun run --cwd packages/shared test], core-runtime, 75) (push) Waiting to run
Test Packaging / Build & Test PyPI Package (push) Waiting to run
Voice Workbench / headless workbench (mocked backends) (push) Has been cancelled
Voice Workbench / real acoustic lane (nightly, provisioned only) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:43:05 +08:00
..

@elizaos/cloud-sdk

TypeScript SDK for Eliza Cloud API access, CLI login, API-key auth, agent management, model APIs, containers, billing credits, and generic endpoint calls.

import { ElizaCloudClient } from "@elizaos/cloud-sdk";

const cloud = new ElizaCloudClient({
  apiKey: process.env.ELIZAOS_CLOUD_API_KEY,
});

const models = await cloud.listModels();
const credits = await cloud.getCreditsBalance();
const agents = await cloud.listAgents();

// Curated public Cloud API routes are also exposed through cloud.routes.
const app = await cloud.routes.getApiV1AppsById({
  pathParams: { id: "app_123" },
});
const stream = await cloud.routes.postApiV1ChatCompletionsRaw({
  json: { model: "gpt-4o-mini", messages: [], stream: true },
});

Sign in with Eliza Cloud (web app) + app-credits

A third-party web app can let users sign in with their Eliza Cloud account — no API key pasting — and bill inference to a registered app's credits (the app owner earns the configured markup). The client exposes the whole flow:

const cloud = new ElizaCloudClient(); // no key needed to start the login

// 1. Start a login session and open the hosted login (a tab works well).
const { sessionId, browserUrl } = await cloud.startCliLogin();
window.open(browserUrl, "_blank");

// 2. Poll until the user authorizes (handles the deadline/interval/terminal
//    states for you; throws on expiry/error/timeout).
const { apiKey, userId } = await cloud.waitForCliLogin(sessionId);
cloud.setApiKey(apiKey!);

// 3. Show/buy app-credits for your registered app.
const balance = await cloud.getAppCreditsBalance("app_123");
const checkout = await cloud.createAppCreditsCheckout({
  app_id: "app_123",
  amount: 5,
  success_url: location.origin,
  cancel_url: location.origin,
});

// 4. Run inference billed to the app's credits via the `appId` option
//    (sends the `X-App-Id` header). Omit `appId` to bill the caller's own credits.
//    Add `affiliateCode` to attribute the call to an affiliate for revenue share
//    (sends `X-Affiliate-Code`; read by the credit-billed inference routes).
const reply = await cloud.createChatCompletion(
  { model: "anthropic/claude-sonnet-4.5", messages: [{ role: "user", content: "hi" }] },
  { appId: "app_123", affiliateCode: "aff_xyz" },
);

For a third-party OAuth-style app sign-in, send the user to the canonical Eliza Cloud app authorization route. Use the SDK helper so your app does not accidentally link to bare /authorize, which is not a Cloud app-auth route:

import { buildAppAuthorizeUrl } from "@elizaos/cloud-sdk";

const authorizeUrl = buildAppAuthorizeUrl({
  appId: "app_123",
  redirectUri: "https://example.app/auth/eliza/callback",
  state: crypto.randomUUID(),
});

window.location.assign(authorizeUrl);

The generated URL is https://elizacloud.ai/app-auth/authorize?app_id=...&redirect_uri=...&state=.... Use /app-auth/authorize; do not use /authorize.

waitForCliLogin(sessionId, { timeoutMs?, intervalMs?, signal? }) and the { appId, affiliateCode } options on createChatCompletion / createResponse / createEmbeddings / generateImage / transcribeAudio exist so browser apps don't have to hand-roll the polling loop or a raw fetch to send X-App-Id / X-Affiliate-Code. appId bills the app and credits the creator markup; affiliateCode credits the affiliate's revenue share. Both are per-call and sent only when set.

Browser note: startCliLogin / pollCliLogin are CORS-friendly (token auth, no cookies). pairWithToken is server/agent-only — it sets an Origin header that browsers forbid fetch from overriding.

cloud.routes is generated from the public Cloud API route tree under apps/api, including both Next-style exported HTTP handlers and Hono app.get / app.post / app.all route modules. It intentionally excludes admin, cron, webhook, internal, dashboard, auth, and MCP transport routes from the package root SDK surface. The route audit still inventories the full route tree so stale generated wrappers fail before publish.

JSON endpoints expose a typed method plus a Raw variant. Always-stream, binary, and text routes return Response from the primary generated method; mixed routes such as chat completions keep the JSON method and use Raw when the request asks for streaming.

Refresh and verify route coverage after adding or changing API routes:

node packages/cloud/sdk/scripts/generate-public-routes.mjs
node packages/cloud/sdk/scripts/audit-api-routes.mjs

Run live e2e tests against the real API with:

ELIZA_CLOUD_SDK_LIVE=1 ELIZAOS_CLOUD_API_KEY=eliza_... bun run test:e2e

The live suite is intentionally split by capability:

  • ELIZA_CLOUD_SDK_LIVE=1 runs public real-API checks for CLI login bootstrap and model listing.
  • ELIZAOS_CLOUD_API_KEY or ELIZA_CLOUD_API_KEY enables authenticated read checks.
  • ELIZA_CLOUD_SESSION_TOKEN enables browser-session-only API key management checks.
  • ELIZA_CLOUD_SDK_LIVE_GENERATION=1 enables paid generation checks.
  • ELIZA_CLOUD_SDK_LIVE_RELAY=1 enables gateway relay lifecycle checks.
  • ELIZA_CLOUD_SDK_LIVE_DESTRUCTIVE=1 must be combined with the specific resource flag before tests create or mutate resources.
  • ELIZA_CLOUD_SDK_LIVE_CONTAINERS=1 and ELIZA_CLOUD_SDK_CONTAINER_IMAGE_URI=... enable container lifecycle checks.
  • ELIZA_CLOUD_SDK_LIVE_AGENT=1 enables Eliza agent lifecycle checks.
  • ELIZA_CLOUD_SDK_LIVE_PROFILE_WRITE=1, ELIZA_CLOUD_SDK_PROFILE_FIELD=..., and ELIZA_CLOUD_SDK_PROFILE_VALUE=... enable profile write checks.
  • ELIZA_CLOUD_SDK_LIVE_OPENAPI=1 forces the OpenAPI check when testing an environment where /api/openapi.json is public. The hosted production endpoint currently requires auth.

Build and publish:

bun run build
npm publish --access public