tekir
All Packages
Frontendv0.1.7

@tekir/next

Next.js SSR integration with API passthrough.

Installation

$bun add @tekir/next

Features

  • Next.js SSR on the same port as your API
  • Auto-detects dev vs production mode
  • Turbopack support via turbopack option
  • API routes stay on tekir, pages on Next.js
  • Custom Next.js config passthrough

Quick Example

TypeScript
import { next } from '@tekir/next'

const app = await tekir()

next(app.server, {
  dir: './frontend',
  dev: process.env.NODE_ENV !== 'production',
})

app.start()

Changelog

v0.1.7LatestSeptember 16, 2026
  • Published output now uses the shared Node-targeted ESM bundle pipeline with external dependencies and generated TypeScript declarations, while Bun consumers keep the native source export.
v0.1.6July 23, 2026
  • Package metadata now follows the shared compatible 0.1.x dependency range used by this coordinated Tekir release.
v0.1.5July 16, 2026
  • The internal Next server and app now close during Tekir shutdown, listener startup errors clean up partial state, and a later request can retry initialization.
v0.1.4June 13, 2026
  • Proxied responses now stream straight through instead of being buffered into memory first, so large or streaming Next responses no longer pay a full-body buffering cost.
  • A failed hop into the internal Next listener now returns 502 Bad Gateway and is logged; a 404 only comes from Next's own response. If Next fails to start, the init state is reset so the next request retries instead of staying broken.
  • Found and fixed with Fable.
v0.1.3May 17, 2026
  • The proxy hop into the internal Next listener now drops every header that the upstream Next process should determine for itself. Hop-by-hop fields (connection, upgrade, keep-alive, te, transfer-encoding, proxy-authorization, content-length) and authority fields (host, forwarded, x-forwarded-*, x-real-ip, x-original-url, x-original-host) are stripped before the inner fetch; an internal host matching the loopback port is set. Closes the SSRF/middleware-bypass surface that comes from blindly forwarding a public request's headers to a private upstream.
  • Starter templates and example apps are pinned to next ^16.2.6 to pick up the upstream proxy/middleware advisories.
v0.1.2May 8, 2026
  • Next middleware honours the tekir test runner signal. When process.env.TEKIR_RUNNER === 'test' the internal Next listener is not started (it would have spun up its own random-port HTTP server otherwise). The fallback handler stays registered and no-ops when nextPort is unset, matching the prod-without-dev-server path. Lets a user entry keep frontend: { type: 'next' } unconditional under tests instead of the per-app NODE_ENV ternary.
v0.1.1April 27, 2026
  • Now supports Next.js 16. Peer range is >=14.0.0 <17.0.0.
v0.1.0April 1, 2026
  • Initial release

Other Frontend packages