Skip to content

Jev directory

TypeSafe JavaScript / TypeScript SDK

Official TypeScript/JavaScript client with inferred answer types, retries, and a question DSL. `npm install @typesafe-ai/sdk`.
Stars
279
Language
TypeScript
License
MIT
Reading time
2 min
Published by
TypeSafe AI
Last verified
Sep 2026

typesafe-ai/typesafe-sdk-js

Organization repository on GitHub

View on GitHub

The official TypeScript/JavaScript library for the TypeSafe API

Forks
43
Last pushed
Updated Oct 2026

Repo stats from the GitHub API, cached Oct 2026.

About this project

JavaScript and TypeScript SDK for TypeSafe AI. Install the SDK (Node.js 20 or newer): Set TYPESAFEAPIKEY in your environment, then create and use the client: Answer types are inferred from your questions. The package includes ESM, CommonJS, and TypeScript declarations. Learn what TypeSafe can do in the TypeSafe docs. See the SDK's client and types for API options and defaults.

Quoted from the project's README. Read the full README.

Highlights

  • Install with npm install @typesafe-ai/sdk; Node.js 20 or newer is required and the package ships ESM, CommonJS, and TypeScript declarations.
  • Answer types are inferred from your questions; the README reads the winner as response.answers.category.choice.
  • The question DSL exports choice(), score(), and noul() helpers from @typesafe-ai/sdk.
  • Retry defaults: maxRetries 2, backoff 500ms doubling to 5000ms, jitter 0.25, retrying HTTP 408, 429, and 500-599, honoring Retry-After up to 60s.
  • The client picks up TYPESAFE_API_KEY from the environment; full option defaults live in src/client.ts and src/types.ts.

Quickstart

ts
import { choice, TypeSafeClient } from "@typesafe-ai/sdk";
const client = new TypeSafeClient();
const response = await client.systemOne({
  state: { document: "I was charged twice. Please fix this ASAP." },
  questions: {
    category: choice("What is this ticket about?", { billing: null, technical: null, other: null }),
  },
});
console.log(response.answers.category.choice);

Watch out

The README is a quickstart only; retry behavior and full API options are documented in the source files and generated API reference, not on the GitHub landing page.

Questions about this entry

Short answers drawn from the linked project or page.

From the Jev guides

Original write-ups on what this entry is for.

From the Jev AI model community

Posts from builders shipping with Jev right now.

Follow @typesafeai