Skip to main content
ForgeDeveloper platform
Back to blog
Developer Tools

TypeScript SDK v3: Full Type Inference

Jamie TorresDecember 20, 20244 min read

We've rebuilt our TypeScript SDK from scratch using conditional types and template literal types. Every API response is now fully typed without any code generation step.

How it works

The SDK infers response types directly from the endpoint path string. Call forge.get('/v2/events') and TypeScript knows the return type is EventList — no generics, no type assertions, no codegen.

// Type is inferred as EventList automatically
const events = await forge.get("/v2/events");

// Type is inferred as WebhookEndpoint
const endpoint = await forge.get("/v2/webhooks/:id", {
  params: { id: "wh_123" },
});