Skip to content

JavaScript / TypeScript SDK

TypeSafe's official JavaScript and TypeScript SDK for Jev, with answer types inferred from your questions.

LibraryproductionMIT

Overview

This is the official TypeSafe AI SDK for JavaScript and TypeScript, published on npm as @typesafe-ai/sdk. A TypeSafeClient reads TYPESAFE_API_KEY from the environment and exposes systemOne(), which takes a state and a map of questions built with helpers such as choice(); answer types are inferred from the questions, so response.answers.category.choice is typed.

It is the standard way for Node.js (version 20+) and TypeScript applications to call Jev, and many projects in this directory build on it. The package ships ESM, CommonJS and TypeScript declarations, is MIT licensed, and points to the TypeSafe docs and its own client and types sources for options and defaults. Because it is maintained by TypeSafe itself, it is the reference point that community clients in other languages tend to mirror, and its client and types source files document the available options and defaults.

What the decision model decides

TypeQuestionAnswers
ChoiceWhat is this ticket about?billing · technical · other

How it works

  1. npm install @typesafe-ai/sdk and set TYPESAFE_API_KEY
  2. Create a TypeSafeClient
  3. Call systemOne with state and typed questions
  4. Read typed answers and probabilities

Strengths

  • Answer types inferred at compile time
  • Official and maintained by TypeSafe
  • ESM, CommonJS and type declarations included

Caveats

  • Requires a TypeSafe API key
  • Node.js 20 or newer

Getting started

`npm install @typesafe-ai/sdk`, set TYPESAFE_API_KEY, then `new TypeSafeClient().systemOne({ state, questions })`.

At a glance

Type
Library
Status
production
Language
TypeScript
Runtime
Node.js 20+
Has code
yes
License
MIT
Stars
276

Use cases and integrations

How curated lists describe it

Frequently asked questions

Is this the official SDK?

Yes, it is published by TypeSafe as @typesafe-ai/sdk.

Are answers typed?

Yes. Answer types are inferred from the questions you pass.

Which Node version is needed?

Node.js 20 or newer.

Related projects

  • Hack Club's lightweight LLM proxy, listed for adding a Jev forwarding endpoint behind its auth, limits and usage logging.

    MCP serverproductionTypeScript
  • Ax, a DSPy-style multi-language LLM framework, listed with a native TypeSafe provider for Boolean, Choice, Score and raw Jev questions.

    PluginproductionTypeScript
  • Effect TypeScript library whose @effect/ai-typesafe package maps classify, probability and rating operations to Jev questions.

    ProjectproductionTypeScript
  • PHP monorepo whose Polyglot module adds a TypeSafe driver for typed Noul, Choice and Score decisions alongside LLM inference.

    ProjectproductionPHP
  • Go MCP server giving any client typed Jev decisions via OpenRouter or TypeSafe, with validated answers and no paid retries.

    MCP serverproductionGo
  • Simon Willison's LLM plugin that adds Jev as a model for yes/no, choice and score questions from the command line.

    PluginproductionPython