Skip to Content
📖 Guide Documents🚀 TutorialWelcome

Welcome to the typia tutorial

This tutorial walks you from “I just heard of typia” to “I have a small typia-powered service that an LLM can drive.” It’s seven short steps. The full project takes about 30 minutes if you copy-paste, an hour or so if you experiment along the way.

What you’ll build

A tiny Bookmark service:

  • A Bookmark interface with constraints (URL format, max-length tags, an optional description)
  • A validator that rejects bad inputs with helpful error paths
  • A JSON loader that reads bookmarks.json from disk and refuses to start if the data is corrupt
  • An HTTP endpoint (via Hono ) that accepts new bookmarks
  • An LLM tool that turns a user message like “save https://typia.io  for me, tag it as docs” into a real bookmark, with self-correction when the LLM gets the schema wrong

Every piece of typia we cover is something you’d actually reach for in a production project. We won’t touch features just to mention them.

What you should already know

  • TypeScript basics — interfaces, type intersections, generics
  • npm / pnpm / bun, whichever you prefer
  • A terminal you can run commands in

You don’t need to know about JSON Schema, OpenAPI, LLM function calling, or the typia internals. We’ll introduce them as they come up.

Tip

If you’d rather try typia before setting up a project locally, head to the browser playground. It compiles in-browser and shows the emitted JavaScript next to your TypeScript — useful for the “should I bother installing this?” decision.

The seven steps

  1. Install — set up ttsc and write a one-line smoke test
  2. First validator — the Bookmark interface and typia.assert
  3. Refining typestags.Format, tags.MaxLength, and friends
  4. JSON parse & stringifyassertParse and assertStringify
  5. LLM function calling — turn a TypeScript class into LLM tools
  6. Plug into a framework — a real Hono endpoint
  7. Next steps — what to read next

Each step is a separate page. You can read straight through, or skip ahead — but the running code example is the same across all of them, so it’s easier the first time if you do them in order.

Tip

If something doesn’t behave the way the tutorial says, the most common cause is a build tool that doesn’t run the typia transform. See the verification step at the end of Install. It catches 95% of “why isn’t this working?” moments.

Ready? → Step 1: Install

Last updated on