All connectors
Frameworks

Next.js

App Router route helpers.

Helpers for Next.js App Router route handlers. Wraps server actions, API routes, and middleware so prompts and tool calls flow through the engine without rewriting handlers.

Install

pnpm add @blackunicorn/bonklm-nextjs

Minimal example

import { withBonkLM } from '@blackunicorn/bonklm-nextjs'

export const POST = withBonkLM(async (req) => {
  const { prompt } = await req.json()
  return Response.json({ ok: true })
}, { validators: ['prompt-injection'] })
Related connectors