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 Source
  • Web chat
  • Slack
agent/agent.tstypescript
import { defineAgent } from "eve";

export default defineAgent({
  model: "anthropic/claude-sonnet-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 and connection grants.

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 Setup and Deployment for the upgrade path.

Getting Started

For the starter and production setup flows, see Setup and Deployment. For the runtime architecture, streaming model, persistence flow, and extension points, see How the Chatbot Works.

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 hosted Vercel Connect integrations.SLACK_CONNECTOR=LINEAR_CONNECTOR=NOTION_CONNECTOR=SENTRY_CONNECTOR=

Create optional Vercel Connect integrations:

bash
# Slack channelvercel connect create slack --name eve-chat-template --triggersvercel connect attach <slack-connector-uid> --triggers --trigger-path /eve/v1/slack --yes
# MCP connectionsvercel connect create mcp.notion.com --name notionvercel connect create https://mcp.linear.app/mcp --name linearvercel connect create https://mcp.sentry.dev/mcp --name sentry

The deploy button does not require these integrations. For manual setup, put the returned connector UIDs in SLACK_CONNECTOR, NOTION_CONNECTOR, LINEAR_CONNECTOR, and SENTRY_CONNECTOR. Local development falls back to slack/eve-chat-template, notion, linear, and sentry, so connectors created with the names above work without editing agent/.

The composer only shows its connections menu when at least one MCP connector is configured. Password-only starter deployments therefore omit the menu and do not prompt eve to use unavailable connections.

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 Notion, Linear, and Sentry MCP connections
  • Vercel Connect-backed Slack channel route at /eve/v1/slack
  • Composer-level connections menu
  • 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.