Next.js Integration
Seamlessly integrate Beam into your Next.js workflow for automatic tunneling.
Installation
Install the Beam CLI and Next.js plugin:
npm install @byronwade/beam @byronwade/beam-next --save-dev
Or using bun/pnpm/yarn:
pnpm add -D @byronwade/beam @byronwade/beam-next
Configuration
Wrap your next.config.js with the Beam plugin. This will automatically start a tunnel when you run next dev.
1234567891011const { withBeam } = require('@byronwade/beam-next');/** @type {import('next').NextConfig} */const nextConfig = {// Your existing config};module.exports = withBeam(nextConfig, {enabled: process.env.NODE_ENV === 'development',port: 3000 // default});
Usage
Just run your development server as usual:
npm run dev
You will see the Beam tunnel URL in your console output:
123456▲ Next.js 14.0.0- Local: http://localhost:3000- Network: http://192.168.1.5:3000➜ Beam: Initializing tunnel...➜ Beam: http://abcdef123456.onion➜ Beam: http://project-name.local
Persistent Domains
Beam allows you to own your domain identity on the Tor network. By generating a keypair once and reusing it, your .onion address remains the same across restarts.
For Next.js projects, this means you can configure webhooks (e.g. Stripe, GitHub) to point to your stable onion address and never have to update them again during development.
Support & Community
Open an issue on our GitHub repository to get help from the team and community.
Open GitHub IssueThis documentation is open source. Feel free to contribute updates or fixes.
Edit on GitHub