Dev Overlay

Local development overlay mode with HMR against production auth and APIs.

riven dev

Run a local development server that overlays onto the production Riven platform. This gives you hot module replacement (HMR) with real authentication and live APIs, without needing to run backend services locally.

bash
riven dev [options]
OptionDefaultDescription
--port <port>3000Local dev server port

How It Works

The dev overlay mode works by:

  1. Starting a local Next.js dev server on the specified port
  2. Setting a riven_dev cookie on app.riven-ai.dev with your local LAN IP and port
  3. The production app detects the cookie and loads a Service Worker
  4. The Service Worker intercepts requests for JS/CSS and redirects them to your local dev server
  5. All API calls and authentication continue to use production services

This means you get full HMR and local code changes reflected immediately, while using production data, auth, and backend APIs.

Usage

bash
# Start dev overlay on default port
cd riven-platform/apps/riven-platform-app
riven dev
 
# Specify a custom port
riven dev --port 4000

If the CLI cannot set the cookie automatically (e.g., due to browser security restrictions), set it manually in your browser console while on app.riven-ai.dev:

javascript
document.cookie = "riven_dev=<lan-ip>:3000; path=/; max-age=43200"

Replace <lan-ip> with your machine's LAN IP address (e.g., 192.168.1.50). The cookie expires after 12 hours.

Stopping the Overlay

To stop the dev overlay and return to the production app, clear the cookie:

javascript
document.cookie = "riven_dev=; path=/; max-age=0"

Or simply close the local dev server and refresh the page.