Redirect Logo
Dashboard
AI
Vercel
Next.js
vercel ai sdk
JavaScript

You Don't Need Next.js for Vercel's AI SDK

Dishant Sharma
Dishant Sharma
Dec 2nd, 2025
5 min read
You Don't Need Next.js for Vercel's AI SDK

A developer on Reddit posted a question last month. "Can i use vercel's ai-sdk on react without the need of nextjs?"​

The responses were mixed. Some said yes. Others linked to Next.js docs. One person just said "Absolutely! There's no requirement for React" which only confused things more. Here's what's funny. The AI SDK documentation has an entire section for Node.js. And Express. And standalone servers. But everyone still thinks it's a Next.js thing.​

I get why. Every tutorial starts with npx create-next-app. Every example uses App Router. The marketing page says "TypeScript toolkit designed to help developers build AI-powered applications with Next.js" right at the top. Then it adds "Vue, Svelte, Node.js, and more" like an afterthought.​

You can use it with plain Node.js. You can use it with Express. You can use it with your weird custom backend that you built three years ago and refuse to rewrite.

The docs no one reads

The official docs have a whole cookbook for API servers. Express examples. Node HTTP server examples. Everything you need.​

Here's a basic Express setup they show:

You import streamText from the ai package. You set up a POST route. You call your LLM. You stream the response back. That's it.​

No React Server Components. No server actions. No app directory. Just regular Express code that looks like every other Express API you've written.

The SDK is just TypeScript. It doesn't care about your framework.

What actually broke the illusion

A guy in the Vercel community forums asked how to use the AI SDK with a separate Node.js backend. He had a Next.js frontend. But his AI logic lived in a Node service. With SSE streaming.​

He asked if the SDK even allows this. The answer was yes. Obviously yes.​

But the question reveals something. The branding is so tied to Next.js that people assume it won't work elsewhere.

I used to think the same thing. I saw "Vercel" and "AI SDK" and assumed it was another framework-locked tool. Then i read the source code. It's just functions. generateText. streamText. generateObject. They take a model and some config. They return responses.​

The UI hooks are the framework-specific part. useChat for React. Similar hooks for Svelte and Vue. But the core SDK? Framework agnostic.​

What people are actually building

Someone deployed a chat app to Docker using the AI SDK. Not on Vercel. Not with Next.js serverless functions. Just a containerized Node app.​

Another team built an education platform with 15k lines of TypeScript. Next.js frontend, Node.js backend. AI SDK handles all the LLM stuff. They're in production with 250 active users.​

A fintech project called CHONK9K uses it for trivia games. Web3 integration. Token rewards. The AI SDK just sits there generating questions and checking answers.​

None of these need Next.js on the backend. They just need the SDK to talk to OpenAI or Anthropic or whatever.

Here's what these projects have in common:

  • Separate backend services

  • Custom business logic between the LLM and user

  • No interest in React Server Components

The Express example everyone should see

The official template for Express is hidden in the Vercel templates. Not on the main AI SDK page. You have to search for it.​

It shows three endpoints. One for basic text generation. One for custom data streaming. One for chat.​

The chat endpoint takes messages as JSON. It calls streamText. It pipes the response back. Standard REST API stuff.​

You can hit this from any frontend. Vanilla JavaScript. React without Next.js. A mobile app. Whatever.

I wasted two hours setting up Next.js before i found this.

Why this matters for backend devs

Most backend developers don't want to learn Next.js. They have Express apps. Or Fastify. Or raw Node HTTP servers.

They want to add AI features. Chat completions. Function calling. Structured data extraction.

The AI SDK does all of this. Provider agnostic. You can swap OpenAI for Anthropic with one line. Built-in streaming. Built-in retries.​

But the documentation starts with frontend frameworks. So backend devs bounce. They go write their own OpenAI wrapper for the fifteenth time.

The random thing about naming

SDK names are weird. "Vercel AI SDK" sounds like it only works on Vercel infrastructure.

It doesn't. You can run it on AWS. Or DigitalOcean. Or your laptop. The name just means Vercel made it.​

This is like when people thought TailwindCSS only worked with React. Or that Vite only worked with Vue. Names create assumptions.

I know a guy who self-hosts everything. He avoided the AI SDK for months because of the Vercel name. Then he tried it. Works fine on his basement server.

Companies should think about this more. A good tool with a confusing name gets ignored.

The honest take

Most people don't need the AI SDK at all. If you're making one or two AI calls, just use the OpenAI client directly. It's simpler.

The SDK helps when you want provider flexibility. Or when you need streaming to work the same way across different models. Or when you're building chat interfaces and don't want to manage message state.

For a simple "generate blog post from title" feature? Overkill.​

For a production chatbot that might switch from GPT-4 to Claude next month? Worth it.

What you actually need to know

The core package is ai. Install it with npm. No Next.js required.​

You get generateText for one-shot completions. You get streamText for streaming responses. You get generateObject for structured output.​

Pick your provider. OpenAI, Anthropic, Google, whatever. Import it. Pass it to the generate function. Done.

If you want the UI hooks, install @ai-sdk/react or @ai-sdk/vue separately. Those are framework-specific. But the core SDK isn't.​

You can use Express and get the full SDK benefits. Authentication stays on your backend. API keys stay secret. You control the routes.​

The frontend just makes POST requests to your API. Like any other REST endpoint.

The ending

That Reddit question still bothers me. "Can i use vercel's ai-sdk on react without the need of nextjs?"

The answer should be obvious. But it's not. Because the docs lead with Next.js. The examples use Next.js. The templates default to Next.js.

Someone in that thread said "refer to the documentation for the Next.js app router". They meant well. But they missed the point.​

The SDK isn't a Next.js tool. It's a TypeScript tool that works with Next.js. And Express. And everything else.

I wish i'd known that earlier. Would have saved me from rebuilding features that already exist.

Enjoyed this article? Check out more posts.

View All Posts