Templates

Chat

A persisted Next.js chat template for eve, built with shadcn/ui, Tailwind CSS, Streamdown, Better Auth, Drizzle, Neon, and Upstash Redis.

View Demo
  • Web chat
  • Slack
agent/agent.tstypescript
import { defineAgent } from "eve";

export default defineAgent({
  model: "anthropic/claude-haiku-4.5",
});

eve Chat Template

A Next.js chat template for eve that starts with password access and browser-persisted chats, then upgrades to Sign in with Vercel, Neon, and Upstash when you need a production multi-user application.

Quick Start

Deploy the starter without provisioning a database or other Marketplace products:

  1. Click Deploy with Vercel.
  2. Enter a strong EVE_CHAT_PASSWORD (16+ characters recommended).
  3. Open the deployed app and enter that password.

Chats and eve session cursors are stored in that browser. They are not shared across browsers or users. Starter mode is intended for one trusted operator: anyone with the password shares the same agent identity.

Deployment Modes

ModeSelected whenAuthenticationChat persistence
StarterEVE_CHAT_PASSWORD is configuredShared password and secure session cookieBrowser localStorage
ProductionNeon, Upstash, and all Sign in with Vercel variables are configuredSign in with VercelNeon
Local developmentNeither mode is configured and next dev is running locallyLocal development identityBrowser localStorage

Production mode takes precedence when its complete environment is present. The app fails closed in a production deployment when neither mode is configured. See for the upgrade path.

Getting Started

For the starter and production setup flows, see . For the runtime architecture, streaming model, persistence flow, and extension points, see .

Install dependencies with pnpm:

bash
pnpm install

Run locally without additional services:

bash
pnpm dev

To require the same password locally, put this in .env.local:

bash
EVE_CHAT_PASSWORD=<at-least-16-characters>

To upgrade the linked project to production mode, run the setup script. It provisions Neon and Upstash, registers Sign in with Vercel, pulls environment variables, and runs migrations:

bash
./scripts/setup.sh# Or: ./scripts/setup.sh --scope <team-slug>

Production mode requires:

bash
DATABASE_URL=BETTER_AUTH_SECRET=NEXT_PUBLIC_VERCEL_APP_CLIENT_ID=VERCEL_APP_CLIENT_SECRET=UPSTASH_REDIS_REST_URL=UPSTASH_REDIS_REST_TOKEN=KV_REST_API_URL=KV_REST_API_TOKEN=

Other optional environment variables:

bash
# Override the app origin for custom production domains.BETTER_AUTH_URL=
# Enable the hosted Slack channel.SLACK_CONNECTOR=

Create the optional Slack channel integration:

bash
vercel connect create slack --name eve-chat-template --triggersvercel connect attach <slack-connector-uid> --triggers --trigger-path /eve/v1/slack --yes

The deploy button does not require Slack. For manual setup, put the returned connector UID in SLACK_CONNECTOR. Local development falls back to slack/eve-chat-template, so a connector created with the name above works without editing agent/.

If the connector is not attached to the linked project, run:

bash
vercel connect attach <connector-uid> --yesvercel env pull .env.local

Production mode only: create the database tables:

bash
pnpm db:migrate

For production, run migrations with Vercel production env vars:

bash
vercel env run -e production -- pnpm db:migrate

Start the development server:

bash
pnpm dev

What Is Included

  • Text chat with an eve agent through same-origin /eve/v1/* routes
  • Password access with browser-backed chat history by default
  • Optional Better Auth sign-in with Vercel
  • Optional Neon-backed cross-device chat history
  • Optional Upstash Redis rate limiting in production mode
  • Drizzle schema and migrations for production mode under lib/db
  • Saved eve session cursors and event snapshots in either storage mode
  • Sidebar history with delete and new-chat actions
  • Vercel Connect-backed Slack channel route at /eve/v1/slack
  • First-message chat titles derived locally from the user's prompt
  • Streamdown markdown rendering for assistant text and reasoning
  • shadcn/Tailwind components for messages, tools, HITL prompts, and composer

This template intentionally does not include file uploads, Vercel Blob, guest mode, NextAuth/Auth.js, or AI Elements.

Agent Code

Edit the agent in agent/agent.ts. Its behavior is defined in agent/instructions.md, and tools live in agent/tools/.

The browser talks to eve with useEveAgent() from eve/react; the app stores eve stream events and session state so /chat/[id] can resume the same durable conversation after refresh.