Sign In

@cueno/sdk

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cueno/sdk

Official SDK for the Cueno runtime prompt-resolution API.

npmnpm
Version
0.1.0
Version published
Weekly downloads
2
100%
Maintainers
1
Weekly downloads
 
Created
Source

@cueno/sdk

Official SDK for the Cueno runtime prompt-resolution API. Resolve a prompt by slug, render it with variables, or pin a specific version — from any JavaScript/TypeScript runtime with fetch (Node 18+, edge, Deno, browsers).

Zero runtime dependencies.

Install

npm install @cueno/sdk

Quick start

import { Cueno } from "@cueno/sdk";

const cueno = new Cueno({
  apiKey: process.env.CUENO_API_KEY!, // e.g. cueno_live_…
  // baseUrl defaults to https://cueno.dev; set it to http://localhost:3000 for local dev
});

// Resolve + render in one call (server validates variables):
const { prompt } = await cueno.prompts.render("support-greeting", {
  company: "Acme",
  customer: "Lee",
});
console.log(prompt);

The API key is a secret and the key's environment is authoritative — a cueno_live_… key only sees production. Keep the key server-side; don't ship it in a browser bundle.

API

cueno.prompts.list();                          // prompts deployed to the key's env
cueno.prompts.get("support-greeting");         // resolve slug → body + variables
cueno.prompts.render("support-greeting", vars);// resolve + interpolate
cueno.prompts.versions("support-greeting");    // version history (newest first)
cueno.prompts.version("support-greeting", "v3");// a specific pinned version

All methods return typed responses (see the exported types). render accepts Record<string, string | number | boolean>.

Errors

Non-2xx responses throw CuenoApiError:

import { CuenoApiError } from "@cueno/sdk";

try {
  await cueno.prompts.render("support-greeting", { company: 123 });
} catch (e) {
  if (e instanceof CuenoApiError) {
    e.code;    // "validation_failed" — branch on this, not e.message
    e.status;  // 422
    e.issues;  // [{ variable: "company", message: "Expected a string value." }]
  }
}
codestatusMeaning
unauthorized401Missing/invalid API key
not_found404Unknown slug, nothing deployed to the env, or unknown version label
invalid_request400Malformed request
validation_failed422Variable values failed validation (see .issues)

Configuration

OptionDefaultNotes
apiKeyRequired.
baseUrlhttps://cueno.devAPI origin, without /api/v1. Set to http://localhost:3000 for local dev.
fetchglobalThis.fetchInject a custom fetch (Node <18, or for tests).

Develop

npm run typecheck   # tsc --noEmit
npm run build       # emit dist/ (ESM + .d.ts)

This package lives inside the Cueno app repo as a standalone, dependency-free package. The endpoint contract it targets is documented in docs/sdk-api.md.

Keywords

cueno

FAQs

Package last updated on 20 Jun 2026

Related posts