TypeScript Guide

TypeScript is the Forge surface for product teams building web apps, browser experiences, server agents, internal tools, and agent-facing UI. Read this tab when Forge needs to sit inside an application stack rather than a low-level runtime workspace.

Language perspective

TypeScript users should think in terms of ergonomic application integration: identity and capability are still mandatory, but the developer experience should feel natural in browser, Node.js, Deno, and Bun projects.

Primary surfaces:

  • forge-ts/packages/forge-core
  • forge-ts/packages/forge-agent
  • forge-ts/packages/forge-identity
  • forge-ts/packages/forge-auth
  • forge-ts/packages/forge-mcp
  • the Rust-WASM crypto module used for parity

Follow this path

  1. Start with Quickstart, then map the sample into your app shell.
  2. Read Web Substrate before adding browser or server rendering flows.
  3. Read Agents, Streaming, and Agent events.
  4. Add Identity, Capabilities, and Tools.
  5. Use Settings to expose provider configuration in UI.
npm test
npm run build
python3 tools/release_gate.py --root .

Contract focus

Contract TypeScript reading lens
Identity Treat identity as app state with cryptographic backing, not a display string.
Streaming Prefer event and chunk surfaces for UI responsiveness.
Tools Separate browser-safe tools from server-side Tier 2 tools.
Providers Use namespace resolution instead of importing vendor clients through agent logic.
WASM Keep crypto-sensitive operations on the shared Rust-WASM path.

Web Substrate

Browser and app-layer guidance for TypeScript Forge surfaces.

Streaming

Native token and event streaming for agent UI.

Settings

Provider and runtime configuration for application settings panels.

MCP integration

Capability-scoped tool bridges in TypeScript-friendly systems.

Current guidance

Use TypeScript for web and application-facing orchestration. Keep the ANVIL contract strict: UI ergonomics should not weaken identity, capability, or telemetry behavior.