> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openchatwidget.com/llms.txt
> Use this file to discover all available pages before exploring further.

# React + Express Example

> Run the Vite + Express example with gpt-5-mini and native OpenAI web search.

This example runs Open Chat Widget in a Vite frontend with an Express backend.
The backend uses `gpt-5-mini` and enables OpenAI's native `web_search` tool.

## Key files

* `examples/basic-react-express-app/src/App.tsx`
* `examples/basic-react-express-app/server/index.ts`
* `examples/basic-react-express-app/README.md`

## Run it

1. Install dependencies:

```bash theme={null}
cd /Users/matt8p/Desktop/openchatwidget/examples/basic-react-express-app
npm install
```

2. Configure environment variables:

```bash theme={null}
cp .env.example .env
```

```env theme={null}
OPENAI_API_KEY=your_key_here
```

3. Start both the frontend and backend:

```bash theme={null}
npm run dev
```

* Frontend: `http://localhost:5173`
* API: `http://localhost:8787/api/chat`

The landing page mounts `<OpenChatWidget />`, and the widget streams responses from the Express `POST /api/chat` endpoint.

<Card title="View repo folder" icon="github" href="https://github.com/Open-Chat-Widget/openchatwidget/tree/main/examples/basic-react-express-app" horizontal>
  Open the full example source on GitHub.
</Card>
