Docs
OfficialJev Repos & SDKs
JavaScript SDK Guide
Quickstart for @typesafe-ai/sdk on Node 20+: answer types inferred from your questions, a choice() helper, and one systemOne call to classify a support ticket.
- Format
- Docs
- Reading time
- 2 min
- Published by
- TypeSafe AI
- Last verified
- Sep 2026
Works forJev for Classification
Used inJev for Customer Support
Highlights
- Install with npm install @typesafe-ai/sdk; Node.js 20 or newer is required.
- The client reads TYPESAFE_API_KEY from the environment.
- Answer types are inferred from your questions; the package ships ESM, CommonJS, and declarations.
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 docs track a specific SDK release, so check the changelog when behavior and examples drift apart.
Questions about this entry
Short answers drawn from the linked project or page.
Node.js 20 or newer. Install with npm install @typesafe-ai/sdk; the client reads TYPESAFE_API_KEY from the environment, and the package ships ESM, CommonJS, and type declarations.
They are inferred from your questions, so response.answers.category.choice is typed from the choice() helper without manual interfaces. The docs track a specific SDK release, so check the changelog when examples drift.
Classifying a support ticket: the state is { document: "I was charged twice. Please fix this ASAP." } and a choice question asks what the ticket is about, with billing, technical, and other options.
The SDK's client and types for API options and defaults, plus the generated API reference and the changelog for versions; this page itself is a quickstart and overview.
Set TYPESAFE_API_KEY in your environment before creating the client; the docs example constructs new TypeSafeClient() with no arguments and reads the key from the environment.
ESM, CommonJS, and TypeScript declarations, so the SDK can be imported from either module system and comes with its own type definitions.
No. In the example they are set to null — billing: null, technical: null, other: null — so the option key is what matters and a description is optional.
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.