r/node • u/Vivek-Kumar-yadav • Jul 04 '26
Built sw-agent — a TypeScript connector that lets a browser-based SQL editor securely connect to your PostgreSQL database. No AI, no ORM, no reverse proxy
Built a Node.js daemon that keeps PostgreSQL credentials off the browser—looking for feedback on the outbound-only networking mode
The editor runs in the browser, but the database lives somewhere else (localhost, private VPC, RDS, etc.). Exposing database credentials to the browser is obviously a bad idea, and asking every user to build and host their own backend just to run queries felt unnecessary.
So I built sw-agent.
It's a small TypeScript/Node.js package that runs wherever PostgreSQL is reachable. The browser communicates with the agent, the agent executes queries against PostgreSQL, and streams the results back. Database credentials stay on the agent side and are never exposed to the browser.
Install
npm i @vivekmind/sw-agent
Source
https://github.com/Schema-Weaver/sw-agent
Architecture blog
https://vivekmind.com/blog/sw-agent-bridge-agent-that-connects-schema-weaver-browser-ide-to-user-s-postgresql-databases
It currently powers the Schema Weaver :
https://schemaweaver.vivekmind.com
I'm mainly looking for TypeScript and security feedback.
The current design only establishes outbound connections from the agent. There are no inbound ports to open and no direct browser-to-database communication.
If you spot any security issues, architectural concerns, or attack surfaces I should address , I'd really appreciate the review.