POST

Default Next.js route handler for Peam

Overview

Exports a ready-to-use POST handler for Next.js route handlers. The handler uses the Next.js createChat wrapper and the configuration produced by withPeam.

Source

import { createChat } from './createChat';

export const POST = createChat().handler;

Usage

export const maxDuration = 30;
export { POST } from '@peam-ai/next/route';

Notes

  • withPeam must run during build so getConfig() can resolve the search store settings.
  • The handler reads the search index via the configured SearchIndexStore injected by the Next.js createChat wrapper.

On this page

GitHubEdit this page on GitHub