Programmatic SDK & framework plugins

Open Burrow tunnels from Node with import { tunnel } from 'useburrow', and wire them into Vite, Next.js, and Nuxt with the useburrow framework plugins.

The useburrow package is both a CLI and a programmatic SDK. Install it as a dependency:

npm i useburrow

Open a tunnel from Node

import { tunnel } from 'useburrow'

const t = await tunnel({ http: 3000, subdomain: 'acme' })
console.log(t.url)      // https://acme.eu.useburrow.dev
// ... do work ...
await t.close()

The tunnel() options mirror the CLI flags (http, tcp, subdomain, domain, region, basicAuth, token, …). Pass a token (or set BURROW_TOKEN) for reserved subdomains and other account features.

Vite

// vite.config.ts
import { burrow } from 'useburrow/vite'

export default {
  plugins: [burrow({ subdomain: 'acme' })],
}

The plugin opens a tunnel when the dev server starts and prints the public URL alongside Vite's local URL.

Next.js

// next.config.ts
import { withBurrow } from 'useburrow/next'

export default withBurrow({
  /* your next config */
})

Nuxt

// nuxt.config.ts
export default {
  modules: [['useburrow/nuxt', { subdomain: 'acme' }]],
}

GitHub Action

Open an ephemeral tunnel inside CI and expose its public URL to later steps:

- name: Open Burrow tunnel
  id: tunnel
  uses: Pixel-Process-UG/burrow-cli/packages/github-action@v1
  with:
    port: 3000
    token: ${{ secrets.BURROW_TOKEN }}

- run: curl -fsS "${{ steps.tunnel.outputs.url }}/health"

The tunnel stays up for the rest of the job and is closed automatically in the action's post step. The public URL is also exported as the BURROW_URL environment variable.