@fal-ai/server-proxy
Version:
The fal.ai server proxy adapter for JavaScript and TypeScript Web frameworks
22 lines (21 loc) • 831 B
TypeScript
import type { ActionFunction, LoaderFunction, json as jsonFunction } from "@remix-run/node";
import { ProxyConfig } from "./config";
export type FalRemixProxy = {
action: ActionFunction;
loader: LoaderFunction;
};
export type FalRemixProxyOptions = Partial<ProxyConfig> & {
/**
* The reference to the `json` function from the Remix runtime.
* e.g. `import { json } from "@remix-run/node";`
*/
json: typeof jsonFunction;
/**
* A function to resolve the API key used by the proxy.
* By default, it uses the `FAL_KEY` environment variable.
*
* @deprecated Use `resolveFalAuth` in `ProxyConfig` instead.
*/
resolveApiKey?: () => Promise<string | undefined>;
};
export declare function createProxy({ json, resolveApiKey, ...config }: FalRemixProxyOptions): FalRemixProxy;