typesafe-ai/typesafe-sdk-js on GitHub
- Stars
- 232
- Forks
- 26
- Language
- TypeScript
- License
- MIT
- Last push
- 15 Sep 2026
Read from GitHub on . Counts change daily.
This is TypeSafe’s own JavaScript and TypeScript client for the API behind Jev, published to npm as @typesafe-ai/sdk. It requires Node.js 20 or newer. After setting TYPESAFE_API_KEY in the environment, creating a client and sending a systemOne request takes a few lines of code. The package exports choice, score and noul helpers for building questions, and the answer type for each question is inferred from its question type, so calling code gets back a typed result rather than something it has to parse or cast itself.
The package ships ESM, CommonJS and TypeScript declarations together. The README is a short quickstart that points to TypeSafe’s docs and to the client and types source files for the full list of options and defaults.
How it uses Jev
import { VERSION } from "./version";
export const DEFAULT_BASE_URL = "https://api.typesafe.ai";
export const DEFAULT_MODEL = "jev-latest";
// ---------------------------------------------------------------------------
// Construction-time checks
// ---------------------------------------------------------------------------
const missingApiKey = (): never => {
throw new TypeSafeError(
`No API key was provided. Pass \`apiKey\` to the TypeSafeClient constructor or set the ${ENV.apiKey} environment variable.`,
);
};
