Vite Plugin
Open a development tunnel when Vite starts listening.
@outray/vite opens an HTTP tunnel for Vite's development server. It is a tunnel plugin, not an application observability SDK.
Install and configure
npm install --save-dev @outray/viteAdd it alongside your existing framework plugins in vite.config.ts:
import { defineConfig } from "vite";
import outray from "@outray/vite";
export default defineConfig({
plugins: [
outray({
apiKey: process.env.OUTRAY_API_KEY,
subdomain: "my-app",
}),
],
});Create a token with tunnel:connect and provide it through a server-side environment variable or the apiKey option. The plugin does not read the CLI's saved login.
Run your normal Vite development command. OutRay waits for the HTTP server's listening event, detects the actual port, and prints the assigned public URL. Closing the dev server closes its tunnel.
Options
| Option | Default | Purpose |
|---|---|---|
apiKey | OUTRAY_API_KEY | Tunnel credential |
subdomain | OUTRAY_SUBDOMAIN | Requested subdomain |
customDomain | Unset | Verified tunnel domain |
serverUrl | OUTRAY_SERVER_URL or wss://connect.outray.co/ | Tunnel server |
enabled | OUTRAY_ENABLED !== "false" | Enable the tunnel plugin |
silent | false | Suppress plugin status output |
local | false | Also advertise LAN access via mDNS |
onTunnelReady(url), onError(error), onClose(), and onReconnecting() let your application react to tunnel lifecycle events. onLocalReady(info) reports the local hostname, IP, and available local URLs when local is enabled.
The plugin applies to Vite's serve command, not production builds. Its package supports Vite 4, 5, 6, and 7.
Authentication and host configuration
Do not put the token in a VITE_* variable or client-side import; Vite exposes those values to browser bundles.
If Vite rejects the tunnel hostname, add the actual public hostname to the development server's allowed hosts. Keep that allowlist specific to the host you use.
If no tunnel starts, check that the server listens on a TCP port rather than a Unix socket, OUTRAY_ENABLED is not "false", and the token has permission for the intended organization.
Telemetry is separate
This plugin does not initialize OpenTelemetry, export application logs or metrics, or provide SDK payload-capture options. The tunnel console can still show traffic passing through the public endpoint.
For a TanStack Start application, configure the TanStack Start SDK separately. Other Node.js servers can use the Node.js SDK.