Next.jsReactStarter

browserbase-nextjs-template — Next.js Starter Template

By browserbase

A Next.js-based browser automation starter template that uses Stagehand and Browserbase to open 5 cloud browser sessions in parallel, retrieve from multiple sources, and have Claude synthesize the research results.

Explore the design

Compare the page layouts and mobile experience. Open any screenshot for a closer look.

2 previews
Desktop homepage1 / 2
Desktop captureTop of page

Actual screenshot captured by the server browser.

All pages & views 2

Screenshots show visual appearance; interactive behavior may differ.

Recorded 2026-10-03View source

What stands out

A quick read of the recorded project description.

01

Opens 5 Browserbase cloud browser sessions in parallel, each researching a different source

02

Drives the browser via Stagehand, with Claude extracting page information according to a structured schema

03

Uses Server-Sent Events to stream each source's findings to the frontend in real time

04

Renders the final synthesized research summary on the frontend using ReactMarkdown

05

Provides a one-click Vercel deployment entry that guides you through configuring Browserbase during deployment

Template Details

This is a Next.js starter template for browser automation and agent workflows. It demonstrates an AI research agent: after receiving a user query, it simultaneously creates 5 Stagehand sessions in the Browserbase cloud, each visiting Google, Wikipedia, YouTube, Hacker News, and Google News respectively. Claude extracts information from the pages according to a structured schema, then streams each source's results to the frontend in real time via Server-Sent Events, and finally synthesizes a Markdown-formatted summary.

The frontend uses Next.js App Router, React, and Tailwind CSS, with results rendered using ReactMarkdown; the backend is a Next.js API Route with a maximum runtime of 300 seconds, and the AI model is called via Vercel AI Gateway to Claude Sonnet. The project structure includes directories such as app/api/research/route.ts, components, context, and results, and provides dev, build, start, and lint scripts.

Before use, you need a Browserbase account with an API Key and Project ID, as well as a Vercel AI Gateway API Key; all three are required environment variables. The repository is released under the MIT license, allowing free use, modification, and distribution, but external services such as Browserbase and Vercel AI Gateway may charge separately; third-party assets in the demo need to be checked for licensing individually.

Next.jsStarter

Is it right for your project?

Use Cases

  • Next.js projects that need to demonstrate parallel multi-browser scraping and real-time result streaming
  • Building browser automation prototypes based on Stagehand and Browserbase
  • Showcasing an AI agent workflow that retrieves from multiple sources and synthesizes summaries

Suitable For

  • Developers familiar with Next.js App Router and API Routes
  • Teams that already have a Browserbase account and want to integrate cloud browsers
  • Developers who need a reference implementation for a research agent or browser automation

Getting started & customization

Use these recorded setup notes alongside the repository instructions for your chosen version.

  1. 1

    Requires Node.js 18 or higher, and one of npm, yarn, pnpm, or bun

  2. 2

    Copy .env.example to .env.local and fill in AI_GATEWAY_API_KEY, BROWSERBASE_API_KEY, and BROWSERBASE_PROJECT_ID

  3. 3

    Browserbase and Vercel AI Gateway are external services that require separate registration and may incur costs

  4. 4

    After running npm run dev, visit http://localhost:3000 to view the page

Read repository instructions

License & source material

Usage conditions & limitations

Free to use · keep license notice

This entry covers the free version of the public repository under the MIT license; the free scope applies to that version's code, not to external services or third-party assets.

Must comply with when using

  • Free use, modification, commercial use, and distribution of this version's code are permitted.
  • When distributing copies or substantial portions of the code, retain the original author's copyright notice and the full MIT license notice.
  • The code is provided as is; warranties and limitations of liability are governed by the original license and applicable law.

Additional costs & items to verify

  • Using this project requires registering a Browserbase account and obtaining an API Key, which is an external service dependency and may incur costs.
  • A Vercel AI Gateway API Key must be configured to call the Claude model, and that external service may bill separately.
  • In addition to the API Key, you must also provide the Browserbase Project ID; all three are required environment variables, and the project cannot run without them.
  • One-click deployment depends on the Vercel platform, and deployment will guide you to bind the Browserbase integration; you need the corresponding accounts before use.
  • Demo images, fonts, icons, and other third-party assets must be checked against their respective licenses and cannot be judged solely by the code's MIT license.
  • External services such as domains, hosting, databases, payments, or AI may charge additional fees.
View Original Text Basis

Permission is hereby granted, free of charge

Original License Text

[Browserbase](https://browserbase.com) account and API key

Original README

[Vercel AI Gateway](https://vercel.com/docs/ai-gateway) API key

Original README

BROWSERBASE_PROJECT_ID=your_project_id

Original README

Deploy this template to Vercel with one click.

Original README
https://github.com/browserbase/browserbase-nextjs-template/blob/main/LICENSEhttps://github.com/browserbase/browserbase-nextjs-template/blob/main/README.md

Compiled by DeepSeek based on repository license and README ·2026-10-03. Results only cover the materials read; dependencies, images, fonts, and subsequent term changes are subject to their respective original texts.

Project checks & description sources

Template Information

Source platforms
GitHub
Documentation and maintenance reference score
More documented · 87 / 100
Technologies
Next.js · React
Website type
Starter
How this score is calculated

Our heuristic uses license records (up to 30), a demo link (12), a preview (10), stars (15), recorded maintenance (15), description completeness (8), feature records (5) and classification data (5). It is not a code, security or performance test, or a Google score. A link does not establish tested functionality.

What to verify for this project

Repository update recorded
2026-02-12
Screenshot last checked
2026-10-03

A demo link is listed. Check it with your own content and viewport sizes; its presence does not confirm that forms, authentication or payments work.

The catalog identifies Next.js as the primary stack. Check the actual dependency manifest and lockfile for versions and hosting requirements. These notes use recorded metadata, not a code audit or a deployment test.

Use a selection guide →

How this description was prepared

AI-assisted description based on catalog records and repository material. Repository authors are not automatically the reviewers of this description.

Review declaration: [email protected] · 2026-10-04

Inspect the recorded source material

SHA-256: a1d4474a05fb0af883f00b22d81774826cf3e1a036955c525a670af6c26ea041

2026-10-03T17:02:06.607Z

Source file / repository
# Stagehand Research Agent

[Demo]() | [Browserbase](https://browserbase.com) | [Stagehand](https://stagehand.dev)

An AI-powered research agent that runs **5 parallel browser sessions** to search the web in real-time. Watch AI agents browse Google, Wikipedia, YouTube, Hacker News, and Google News simultaneously, then synthesize findings into a comprehensive summary.

## Deploy

Deploy this template to Vercel with one click. The Vercel Marketplace will automatically prompt you to set up Browserbase.

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fbrowserbase%2Fbrowserbase-nextjs-template&stores=%5B%7B%22type%22%3A%22integration%22%2C%22protocol%22%3A%22other%22%2C%22productSlug%22%3A%22browserbase%22%2C%22integrationSlug%22%3A%22browserbase%22%7D%5D)


## Features

- **Parallel Browser Sessions**: 5 browsers run simultaneously, each researching a different source
- **Live Browser Views**: Watch AI agents navigate the web in real-time
- **Multi-Source Research**: Searches Google, Wikipedia, YouTube, Hacker News, and Google News
- **AI-Powered Extraction**: Uses Claude to intelligently extract relevant information from pages
- **Smart Synthesis**: Combines findings into a structured, comprehensive summary
- **Real-time Streaming**: Server-Sent Events deliver results as they're discovered

## Tech Stack

### Frontend
- **Framework**: Next.js 15 with React 19 and TypeScript
- **Styling**: Tailwind CSS 4
- **Markdown**: ReactMarkdown for rendering summaries

### Backend
- **AI Model**: Claude Sonnet via Vercel AI Gateway
- **Browser Automation**: [Stagehand](https://stagehand.dev) + [Browserbase](https://browserbase.com)
- **Streaming**: Server-Sent Events (SSE)
- **Runtime**: Next.js API Routes with 300s max duration

### Infrastructure
- **Browser Infrastructure**: Browserbase cloud browsers
- **AI Gateway**: Vercel AI Gateway
- **Deployment**: Vercel

## Prerequisites

- Node.js 18.x or later
- npm, yarn, pnpm, or bun
- [Browserbase](https://browserbase.com) account and API key
- [Vercel AI Gateway](https://vercel.com/docs/ai-gateway) API key

## Getting Started

### 1. Clone the repository

```bash
git clone https://github.com/browserbase/browserbase-nextjs-template
cd research-agent-template
```

### 2. Install dependencies

```bash
npm install
# or
pnpm install
```

### 3. Configure environment variables

```bash
cp .env.example .env.local
```

Edit `.env.local` with your API keys:

```env
# Vercel AI Gateway API Key
# Get yours at: https://vercel.com/docs/ai-gateway
AI_GATEWAY_API_KEY=your_ai_gateway_key

# Browserbase (for cloud browser sessions)
# Get yours at: https://browserbase.com
BROWSERBASE_PROJECT_ID=your_project_id
BROWSERBASE_API_KEY=your_api_key
```

### 4. Start the development server

```bash
npm run dev
```

### 5. Open your browser

Navigate to [http://localhost:3000](http://localhost:3000)

## Environment Variables

| Variable | Description | Required |
|----------|-------------|----------|
| `AI_GATEWAY_API_KEY` | Vercel AI Gateway API key for Claude access | Yes |
| `BROWSERBASE_API_KEY` | Your Browserbase API key | Yes |
| `BROWSERBASE_PROJECT_ID` | Your Browserbase project ID | Yes |

## Usage

1. **Enter a Query**: Type any research question or select from example queries:
   - "What is quantum computing?"
   - "Latest developments in AI"
   - "How does blockchain work?"

2. **Watch the Research**: See 5 browser windows researching in parallel, each exploring a different source

3. **Get Results**: Receive findings from each source as they complete, followed by an AI-synthesized summary

## How It Works

1. **Session Creation**: Creates 5 parallel Stagehand sessions on Browserbase
2. **Parallel Research**: Each session navigates to a different source (Google, Wikipedia, etc.)
3. **AI Extraction**: Claude extracts relevant information from each page using structured schemas
4. **Real-time Streaming**: Findings stream to the frontend as SSE events
5. **Synthesis**: Claude combines all findings into a formatted summary

## Available Scripts

```bash
# Development server
npm run dev

# Production build
npm run build

# Start production server
npm run start

# Lint code
npm run lint
```

## Project Structure

```
├── app/
│   ├── api/
│   │   └── research/
│   │       └── route.ts      # Research API with parallel Stagehand sessions
│   ├── components/           # React components
│   ├── context/              # Research context provider
│   ├── results/              # Results page
│   ├── page.tsx              # Home page
│   └── layout.tsx            # Root layout
├── public/                   # Static assets
└── .env.example              # Environment variables template
```

## License

MIT

## Acknowledgments

- [Browserbase](https://browserbase.com) - Cloud browser infrastructure
- [Stagehand](https://stagehand.dev) - AI-powered browser automation
- [Vercel](https://vercel.com) - Hosting and AI Gateway
- [Anthropic](https://anthropic.com) - Claude AI model
Report a correction

Explore similar templates

Compare previews and descriptions within the same stack and category.