- Home
- Skills
- Dchuk
- Claude Code Tauri Skills
- Tauri Nodejs Sidecar
tauri-nodejs-sidecar_skill
12
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill dchuk/claude-code-tauri-skills --skill tauri-nodejs-sidecar- SKILL.md9.5 KB
Overview
This skill guides you through running Node.js as a sidecar process inside Tauri v2 applications so you can use npm packages and JavaScript backend logic without requiring end users to install Node.js. It covers setup, packaging the Node binary with pkg, Tauri configuration for external binaries and permissions, and safe communication patterns for both one-off commands and long-running HTTP sidecars.
How this skill works
It builds your Node.js script into a standalone binary with a tool like pkg, renames and places that binary into your Tauri src-tauri/binaries folder with the target triple, and registers it as an external sidecar in tauri.conf.json. The Tauri shell plugin runs the sidecar and forwards arguments or environment variables; frontend or Rust backend code then invokes the sidecar synchronously, streams output, or interacts over HTTP for persistent processes.
When to use it
- You need npm packages or JS libraries not available in Rust
- You want to bundle Node runtime logic so end users need no Node install
- You need to isolate complex JS tooling from the main Tauri process
- You require long-running local services (HTTP) alongside the desktop app
- You want cross-platform distribution with a single app bundle
Best practices
- Validate and restrict sidecar arguments in capability configs instead of allowing arbitrary args
- Bind any HTTP sidecar to 127.0.0.1 and validate requests server-side
- Ensure sidecar processes terminate when the app closes and handle SIGTERM cleanly
- Make binaries executable post-build and verify rustc host triple matches binary naming
- Use streaming APIs for long outputs and check stderr on failures
Example use cases
- Bundle a Node-based CLI tool invoked from the UI (hello/add examples)
- Run a local Node HTTP microservice for session/state handling with health endpoints
- Use pkg to produce platform-specific Node binaries and include them in tauri bundle
- Call sidecar from Rust commands for heavy JS-only processing and return results to frontend
- Stream logs from the sidecar to the UI during long-running tasks
FAQ
No. The sidecar binary built with pkg contains the Node runtime so end users do not need a separate Node installation.
How do I secure sidecar interactions?
Restrict allowed arguments in capabilities, validate all inputs both in Tauri and the sidecar, bind HTTP sidecars to 127.0.0.1, and avoid exposing raw shell execution.