JavaScript configs work too. The package exposes both ESM and CommonJS entry points.
next-qr
QR codes for your Next.js dev server
Print LAN URLs and scannable terminal QR codes for local Next.js development so phones and tablets on the same network can open your app instantly.
The Problem
Mobile testing should not start with copying local IP addresses
Without next-qr
Find the right LAN IP, port, and path every time you switch devices.
Type long local URLs manually on a phone, or paste them through chat.
Repeat the process whenever the port or active network changes.
Lose time before you even start checking the responsive UI.
Local: http://localhost:3000
Network: http://192.168.0.14:3000
// now copy this into a phone somehow
With next-qr
Wrap your `next.config.*` once and keep route files untouched.
Print QR codes when the dev server is reachable on the local network.
Prefer the interface you want, or filter hosts and URLs explicitly.
Keep mobile QA focused on the app instead of environment setup.
Use the same package across Pages Router and App Router projects.
Visit your Next.js app on mobile:
http://192.168.0.14:3000
QR printed in terminal
Scan and open on your device
Features
Built for the real shape of local Next.js development
Terminal-first QR output
Prints LAN URLs and QR codes directly where you already run `next dev`.
Config-level integration
Works through `next.config.*`, so App Router and Pages Router projects use the same setup.
Bundler-aware behavior
Detects Webpack and Turbopack automatically, with explicit override support when you need it.
Network targeting controls
Tune `hostFamily`, include or exclude raw hosts, set a preferred interface, and append custom paths.
Useful filtering hooks
Use `filter` and `logger` options when you want custom output rules or custom logging.
Smart defaults
Defaults to `once: true`, `protocol: "http"`, `hostFamily: "ipv4"`, and port fallback from args, `PORT`, then `3000`.
CLI setup helpers
`next-qr init` injects `withQRCode`, and `next-qr doctor` verifies the project wiring.
Utility exports included
Use `printQRCodes`, `getLocalNetworkUrls`, or `getPreferredNetworkUrl` in your own tooling.
Config Surface
Quick start, CLI helpers, runtime options, and exported APIs
next-qr stays small on purpose: one wrapper, a few CLI commands, focused options, and utilities you can reuse in your own dev tooling.
Injects `withQRCode` into the detected app config and installs the package if needed.
Checks for a supported Next.js project, installed package, config file, and wrapper usage.
`auto`, `webpack`, or `turbopack`.
Disable output without removing the wrapper.
Override port resolution when you need a fixed value.
Append a path such as `/preview` to generated URLs.
Switch to `https` for unusual local HTTPS setups.
Defaults to `true`; repeated output is mainly a Webpack-mode concern.
Decide which generated URLs should actually be printed.
Send output through a custom logger object.
Choose `ipv4`, `ipv6`, or `all`.
Whitelist raw interface addresses before URLs are built.
Blacklist raw interface addresses before URLs are built.
Move one network interface to the top of the list.
Delay port checks in Turbopack mode.
Stop waiting if Turbopack never becomes reachable.
Wrap a Next.js config and enable QR printing in development.
Use the plugin directly when you manage Webpack plugins yourself.
Print URLs and QR codes immediately, returning the generated URLs.
Return LAN URLs without printing anything.
Return the first URL after interface preference ordering, or `null`.