Direct vs. Proxied Calls
Architecture
Setting Up a Proxy
The following example uses a Node.js Express server as the proxy. If you are using Next.js, see the Next.js Proxy guide for a more complete integration.1
Install Express
Add Express (and optionally
node-cache for caching) to your project.2
Create the proxy route
Create a file at
server/proxy.js (or wherever your backend lives) with the following contents.3
Set the environment variable
Add the Railway URL to your server environment. Never commit this value to source control.
4
Mount the router
Mount the proxy router in your main Express app.
Error Handling
ParaLens returns three meaningful HTTP status codes. Your client should handle each one explicitly.Caching
Ethereum transactions are immutable once confirmed. A transaction hash always resolves to the same on-chain data, so caching responses by hash is safe and strongly recommended. A minimal in-memory cache example:TypeScript Types
Use these minimal interfaces to type the parts ofTxReport most relevant to frontend rendering. The full schema includes additional fields; see Dashboard Layouts for guidance on which fields to surface per intent kind.