@wefterjs/devtools is a Vite plugin that connects your running mobile application to an inspection environment. It captures bridge invocations, native event dispatches, network traffic, and console output, displaying them in a desktop browser dashboard.
Installation
Install as a development dependency in your web application project:
pnpm add -D @wefterjs/devtools
Setup in Vite
Add wefterDevtools to your vite.config.ts plugins array:
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { wefterDevtools } from "@wefterjs/devtools";
export default defineConfig({
plugins: [vue(), wefterDevtools()],
});
The plugin only activates during local development (apply: "serve"). It is automatically excluded from production builds.
How it works
When the Vite development server starts:
- Client agent injection: The plugin hooks
transformIndexHtml to inject a lightweight client agent module into the application <head>.
- Bridge instrumentation: Inside the running app,
@wefterjs/core detects the devtools agent and routes bridge telemetry (payloads, response times, errors) to the local Vite server over WebSockets.
- Console, network and deep link monitoring:
console.* calls, uncaught errors, fetch and XMLHttpRequest traffic, and the deep links delivered to onDeepLink are captured and forwarded to the dev server, which keeps a bounded history (500 bridge calls, 1000 console entries, 500 requests, 200 deep links).
- Desktop dashboard: The dashboard at
/__wefter-devtools replays that history on open and then streams new events live. wefter run prints its URL when the dev server starts.
The dashboard
| Panel |
What it shows |
| Bridge |
Every invokeNative call, oldest first: status, plugin.method, an inline preview of the arguments, duration with a waterfall bar, and start time. Select a call to open the inspector with its arguments, result or error, and the native stack trace when the shell sends one. |
| Console |
App console output and uncaught exceptions. Filter by level, repeated lines collapse into one row with a count, objects expand as trees, and rows with a stack trace expand inline. |
| Network |
fetch and XHR requests, with request headers and a parsed response preview in the inspector. |
| Deep Links |
Every link delivered to onDeepLink: whether it launched the app, arrived while it ran or was sent from here, its scheme, in-app path, query and how many listeners received it. Links nobody handled are highlighted, and the toolbar shows whether the app is listening at all. Test a link with Send to app (delivered through onDeepLink, testing the app's routing) or Open on Android / Open on iOS Simulator (through the operating system with adb or xcrun simctl, testing the native registration too). Each environment's links from wefter.config.json are listed as examples that fill the tester. |
| Plugins |
The plugins in wefter.config.json: methods, hooks, events, declared permissions, which platforms have native source, and how often each was called this session. |
The Bridge, Console and Network panels can be paused: the view freezes, events keep arriving, and the Resume button shows how many came in meanwhile. The count next to each tab shows failed calls, console errors (or warnings), failed requests and deep links nobody handled.
Keyboard shortcuts:
| Key |
Action |
/ or Ctrl/⌘ K |
Focus the current panel's filter (Esc clears it) |
1–5 |
Switch panel |
↑ ↓ Home End |
Move between rows; the inspector follows the selection |
Enter / Space |
Open or close the inspector for the focused row |
Esc |
Close the inspector |
The dashboard follows the system light or dark setting; the button in the top bar switches it and remembers the choice.
Dashboard and routes
The devtools server adds internal middleware routes to your Vite server:
| Route |
Description |
/__wefter-devtools |
The dashboard described above. |
/__wefter-devtools/api/plugins |
JSON endpoint returning metadata for all plugins declared in wefter.config.json, including exported methods, supported hooks, and required permissions. |
/__wefter-devtools/api/deep-links |
JSON endpoint returning each environment's deep link schemes, domains and paths from wefter.config.json. |
/__wefter-devtools/api/open-link |
POST { "url", "platform": "android" \| "ios" } opens the link on an Android device (adb) or the booted iOS Simulator, answering { ok, output }. |
/__wefter-devtools/api/reload |
POST reloads every connected app, answering { clients }. |
WebSocket messages
The app, the dev server and the dashboard talk over Vite's HMR WebSocket using these events (see src/shared/events.ts):
wefter:bridge_call / wefter:bridge_response: an invokeNative call and its result, error and duration.
wefter:console: captured console output and uncaught errors.
wefter:network_request / wefter:network_response: captured requests and their responses.
wefter:client_hello / wefter:client_list: app presence.
wefter:deep_link / wefter:deep_link_listeners: a link delivered to onDeepLink, and the app's listener count.
wefter:simulate_deep_link: delivers a link to every connected app (sent by the Deep Links panel's Send to app button).
wefter:reload: reloads every connected app (sent by the dashboard's Reload app button).
Development
pnpm build # compiles TypeScript and bundles the client agent via esbuild
pnpm test # runs unit tests with Vitest and JSDOM
License
MIT © 2026 Sandip Ghimire