Skip to main content

Running the Hello World Example

  1. Create a Next.js project (or use an existing one):
  1. Install m4trix:
  1. Create app/api/chat/route.ts with the Hello World code.
  2. Start the dev server:
  1. Call the API:

Expected Output

You’ll receive an SSE stream:
Or from a browser, use EventSource or fetch with ReadableStream to consume the stream.

Next