
Security News
Socket Releases Free Certified Patches for Critical vm2 Sandbox Escape
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.
@fal-ai/server-proxy
Advanced tools
The fal.ai server proxy adapter for JavaScript and TypeScript Web frameworks
The @fal-ai/server-proxy library enables you to route client requests through your own server, therefore safeguarding sensitive credentials. With built-in support for popular frameworks like Next.js and Express, setting up the proxy becomes a breeze.
npm install --save @fal-ai/server-proxy
For Next.js applications using the page router:
pages/api/fal/proxy.js (or .ts if you're using TypeScript):export { handler as default } from "@fal-ai/server-proxy/nextjs";
FAL_KEY as an environment variable in your server, containing a valid API Key.For Next.js applications using the app router:
Create an API route in your Next.js app, as a convention we suggest using app/api/fal/proxy/route.js (or .ts if you're using TypeScript):
Re-export the proxy handler from the library as the default export:
import { route } from "@fal-ai/server-proxy/nextjs";
export const { GET, POST, PUT } = route;
Ensure you've set the FAL_KEY as an environment variable in your server, containing a valid API Key.
For Express applications:
Make sure your app supports JSON payloads, either by using express.json() (recommended) or body-parser:
app.use(express.json());
Add the proxy route and its handler. Note that if your client lives outside of the express app (i.e. the express app is solely used as an external API for other clients), you will need to allow CORS on the proxy route:
import * as falProxy from "@fal-ai/server-proxy/express";
app.all(
falProxy.route, // '/api/fal/proxy' or you can use your own
cors(), // if external clients will use the proxy
falProxy.handler,
);
Ensure you've set the FAL_KEY as an environment variable in your server, containing a valid API Key.
Once you've set up the proxy, you can configure the client to use it:
import { fal } from "@fal-ai/client";
fal.config({
proxyUrl: "/api/fal/proxy", // or https://my.app.com/api/fal/proxy
});
Now all your client calls will route through your server proxy, so your credentials are protected.
For a deeper dive into the proxy library and its capabilities, explore the official documentation.
FAQs
The fal.ai server proxy adapter for JavaScript and TypeScript Web frameworks
The npm package @fal-ai/server-proxy receives a total of 18,139 weekly downloads. As such, @fal-ai/server-proxy popularity was classified as popular.
We found that @fal-ai/server-proxy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.

Research
Five malicious NuGet packages impersonate Chinese .NET libraries to deploy a stealer targeting browser credentials, crypto wallets, SSH keys, and local files.

Security News
pnpm 11 turns on a 1-day Minimum Release Age and blocks exotic subdeps by default, adding safeguards against fast-moving supply chain attacks.