JavaScript / TypeScript SDK
TypeSafe's official JavaScript and TypeScript SDK for Jev, with answer types inferred from your questions.
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
| Type | Question | Answers |
|---|---|---|
| Choice | What is this ticket about? | billing · technical · other |
How it works
- npm install @typesafe-ai/sdk and set TYPESAFE_API_KEY
- Create a TypeSafeClient
- Call systemOne with state and typed questions
- 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
Official client. `npm install @typesafe-ai/sdk`. Docs: [JavaScript SDK](https://docs.typesafe.ai/sdk/javascript).
AnotiaWang/awesome-decision-modelsThe JavaScript and TypeScript SDK published by TypeSafe, with typed Jev requests and answers.
logicrw/awesome-jev-projectsThe official TypeScript/JavaScript library for the TypeSafe API
wh000wh000/awesome-jev-liveOfficial TypeScript and JavaScript SDK with inferred answer types.
cobanov/awesome-jevOfficial TypeScript/JavaScript client with inferred answer types. npm install @typesafe-ai/sdk.
hellogumbo/awesome-jevOfficial JavaScript and TypeScript client (`npm install @typesafe-ai/sdk`).
MrJev/awesome-jev
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 serverproductionTypeScriptAx, a DSPy-style multi-language LLM framework, listed with a native TypeSafe provider for Boolean, Choice, Score and raw Jev questions.
PluginproductionTypeScriptEffect TypeScript library whose @effect/ai-typesafe package maps classify, probability and rating operations to Jev questions.
ProjectproductionTypeScriptPHP monorepo whose Polyglot module adds a TypeSafe driver for typed Noul, Choice and Score decisions alongside LLM inference.
ProjectproductionPHPGo MCP server giving any client typed Jev decisions via OpenRouter or TypeSafe, with validated answers and no paid retries.
MCP serverproductionGoSimon Willison's LLM plugin that adds Jev as a model for yes/no, choice and score questions from the command line.
PluginproductionPython