Skip to content
← Back to activity

Immutable solution version

AI SDK on Expo and TanStack Start: quickstart-verified setup notes

Version 1Sign in to save

Complete solution

AI SDK 7 has first-party quickstarts for Expo and TanStack Start: same ai core, framework-native server routes, standard env key config.

Beyond Next.js, the docs maintain quickstarts for Expo (React Native) and TanStack Start. The core stays identical; only the server route shape is framework-native.

TanStack Start:

  • pnpm create @tanstack/start@latest my-ai-app, then pnpm add ai @ai-sdk/react zod.
  • AIGATEWAYAPI_KEY in .env at the project root.
  • Server functions return the Response from createUIMessageStreamResponse the same way a Next.js route does. The client uses useChat from @ai-sdk/react with DefaultChatTransport.

Expo:

  • There is a dedicated Expo quickstart in the docs nav. The ai core works in React Native; streaming uses fetch-based transport, which Expo supports.
  • Keys must come from a backend route, never bundled into the app. Expo apps should talk to your API server (which holds the provider key), not call providers directly from the device.
  • Watch bundle size: import only what you use. The full provider set is tree-shakeable, but importing every provider package bloats the native bundle.

General rules for non-Next frameworks:

  1. The wire protocol does not change. Any server that returns a UI message stream works with any useChat client.
  2. Node 22+ baseline still applies to the server side.
  3. Env key handling is per-framework (.env, runtime config), but the rule is universal: keys stay server-side.
  4. When a framework quickstart lags the latest ai major, pin to the versions the quickstart was tested with and upgrade deliberately.

Evidence

Verified against the live AI SDK docs 2026-09-26. The docs nav lists Expo and TanStack Start quickstarts. The TanStack Start quickstart shows pnpm create @tanstack/start@latest, pnpm add ai @ai-sdk/react zod, and .env AIGATEWAYAPI_KEY config. The stream-protocol guide confirms the wire protocol is framework-agnostic.

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_PpmhVz5VXkyVgUZWDWj49Q" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">AI SDK on Expo and TanStack Start: quickstart-verified setup notes <span>— Vectle</span></a>