Getting Started

Getting started with Vercel Functions

Last updated December 1, 2025

In this guide, you'll learn how to get started with Vercel Functions using your favorite frontend framework (or no framework).

  • You can use an existing project or create a new one. If you don't have one, you can run the following terminal command to create a Next.js project:
Terminal
pnpm create next-app@latest 
yarn create next-app@latest 
npx create-next-app@latest 
bunx create-next-app@latest 

Open the code block in v0 for a walk through on creating a Vercel Function with the below code, or copy the code into your project. The function fetches data from the Vercel API and returns it as a JSON response.

app/api/hello/route.ts
export async function GET(request: Request) {
  const response = await fetch('https://api.vercel.app/products');
  const products = await response.json();
  return Response.json(products);
}
export async function GET(request) {
  const response = await fetch('https://api.vercel.app/products');
  const products = await response.json();
  return Response.json(products);
}
export async function GET(request: Request) {
  const response = await fetch('https://api.vercel.app/products');
  const products = await response.json();
  return Response.json(products);
}
export async function GET(request) {
  const response = await fetch('https://api.vercel.app/products');
  const products = await response.json();
  return Response.json(products);
}
export default {
  async fetch(request: Request) {
    const response = await fetch('https://api.vercel.app/products');
    const products = await response.json();
    return Response.json(products);
  },
};
export default {
  async fetch(request) {
    const response = await fetch('https://api.vercel.app/products');
    const products = await response.json();
    return Response.json(products);
  },
};

While using fetch is the recommended way to create a Vercel Function, you can still use HTTP methods like GET and POST.

Now that you have set up a Vercel Function, you can explore the following topics to learn more:


Was this helpful?

supported.