JevHub guide

Getting started with Jev

The shortest path is: install the official SDK, set a TypeSafe API key, send state plus typed questions, then use the returned decision in your own code.

1. Prerequisites

The current official JavaScript SDK requires Node.js 20 or newer and a TypeSafe API key.

2. Install the official SDK

npm install @typesafe-ai/sdk

Set TYPESAFE_API_KEY in your server environment. Keep the key on the server. The official client refuses browser use by default because shipping the key to a web page would expose it.

3. Send a first decision

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);

This follows the shape of the official JavaScript SDK quickstart: a short support message becomes a bounded ticket-category decision.

4. Understand state

state is the information the model should judge. It can be text or JSON-compatible structured data. Prefer explicit fields when your application already knows facts such as payment status, user role, tool events, or allowed routes.

5. Understand questions

Each named question becomes a typed answer. Choice selects among named alternatives. Noul returns the probability of yes. Score uses an ordered list of rubric descriptions and returns an expected score plus probabilities.

import { choice, noul, score, TypeSafeClient } from "@typesafe-ai/sdk";

const client = new TypeSafeClient();

const response = await client.systemOne({
  state: {
    message: "Our checkout failed twice and launch is tomorrow.",
  },
  questions: {
    route: choice("Which queue should own this?", {
      billing: "Payment and charge issues",
      technical: "Product or integration failures",
      other: "Everything else",
    }),
    urgent: noul("Is this time-sensitive?"),
    severity: score("How severe is the impact?", [
      "Low",
      "Moderate",
      "High",
      "Critical",
    ]),
  },
});

Common mistakes

Primary source

This page was checked against the official JavaScript SDK v0.6.0 source and README on 2026-09-21.

Official TypeSafe JavaScript SDK ↗

Next

Try a concrete pattern in Templates, calculate projected usage in the Cost Calculator, or review the conceptual boundary in Jev vs ChatGPT.