New Project

Get Started with Upstash Vector & Next.js

A simple example to demonstrate Upstash Vector with Next.js.

DeployView Demo
This is an auto-uploaded thumbnail from https://vercel.com/templates/submit.

Upstash Vector & Next.js Example

In this example, you can find how you can use Upstash Vector with Next.js.

The client is initialized in /src/app/api/route.ts folder like:

import { Index } from "@upstash/vector";
const index = new Index({
url: process.env.UPSTASH_VECTOR_REST_URL,
token: process.env.UPSTASH_VECTOR_REST_TOKEN,
})
export const GET = async () => {
// ...
}

Local Development

First, install the dependencies with:

npm install

Then, create a .env.local file and fill the environment variables:

UPSTASH_VECTOR_REST_URL="***"
UPSTASH_VECTOR_REST_TOKEN="***"

Finally, run:

npm run dev

Deployment

You can deploy with:

npm run deploy

Then, set the environment variables in your project, redeploy and start using the app on Vercel!

GitHub Repoupstash/vector-js
LicenseView License
Use Cases
Starter
Stack
Next.js
Tailwind
Database
Upstash

Related Templates

Next.js Boilerplate

Get started with Next.js and React in seconds.
Next.js Boilerplate thumbnail

Upstash Vector + Vercel AI SDK Starter

A RAG chatbot starter for expert answers on university degrees. Built using Vercel AI SDK, LangChain, Upstash Vector, and OpenAI.
Upstash Vector + Vercel AI SDK Starter thumbnail
DeployView Demo