Skip to content

Meta-package

@web-ai-sdk/all is a thin meta-package that re-exports the five other scoped @web-ai-sdk/* building blocks under a single install. It has no behaviour of its own. All logic, tests, and version history live in the scoped packages.

Reach for it when you want one entry in package.json instead of five, or when you’re prototyping and don’t care yet which blocks you’ll keep.

Install

Terminal window
pnpm add @web-ai-sdk/all
# or: npm i @web-ai-sdk/all / bun add @web-ai-sdk/all

The five scoped packages come along as transitive dependencies. react is a peer dependency only when you import any /react subpath.

Two import shapes

Both are valid. Pick whichever reads better at the call site.

Bundlers tree-shake this cleanly; you only pay for the blocks you actually use.

import { ask, createSession } from "@web-ai-sdk/all/prompt";
import { summarize } from "@web-ai-sdk/all/summarizer";
import { translate } from "@web-ai-sdk/all/translator";
import { detect } from "@web-ai-sdk/all/detector";
import { registerTool, defineTool } from "@web-ai-sdk/all/webmcp";
import { usePrompt, useSession } from "@web-ai-sdk/all/prompt/react";
import { useSummarizer } from "@web-ai-sdk/all/summarizer/react";

Namespaced root (handy for prototyping)

import { prompt, summarizer, translator, detector, webmcp } from "@web-ai-sdk/all";
await prompt.ask({ input: "Hello" });
await summarizer.summarize({ language: "en", article: document.body });

Why namespaced and not flat? Several names (checkAvailability, defaultCacheKey, createSessionStorageCache) appear in more than one package, so a flat re-export at the root would collide. Namespacing keeps each block’s surface intact.

When not to use the meta-package

Use the scoped packages directly when:

  • You’re shipping a library and want minimal transitive deps for downstream consumers.
  • You need to pin one block to a different version than the rest.

For applications, the meta-package is usually the right default.

Versioning

@web-ai-sdk/all and the five other scoped packages release together. Every release ships all six at the same version via a Changesets fixed group, so pinning a single version in your package.json gets you the whole suite at a known state.

Available subpaths

SubpathRe-exports
@web-ai-sdk/allnamespaces for all five packages
@web-ai-sdk/all/prompt@web-ai-sdk/prompt
@web-ai-sdk/all/prompt/react@web-ai-sdk/prompt/react
@web-ai-sdk/all/webmcp@web-ai-sdk/webmcp
@web-ai-sdk/all/webmcp/react@web-ai-sdk/webmcp/react
@web-ai-sdk/all/summarizer@web-ai-sdk/summarizer
@web-ai-sdk/all/summarizer/react@web-ai-sdk/summarizer/react
@web-ai-sdk/all/translator@web-ai-sdk/translator
@web-ai-sdk/all/translator/react@web-ai-sdk/translator/react
@web-ai-sdk/all/detector@web-ai-sdk/detector
@web-ai-sdk/all/detector/react@web-ai-sdk/detector/react