UNPKG

@fal-ai/server-proxy

Version:

The fal.ai server proxy adapter for JavaScript and TypeScript Web frameworks

21 lines (20 loc) 744 B
import { Context } from "hono"; export type FalHonoProxyOptions = { /** * A function to resolve the API key used by the proxy. * By default, it uses the `FAL_KEY` environment variable. */ resolveApiKey?: () => Promise<string | undefined>; }; type RouteHandler = (context: Context) => Promise<Response>; /** * Creates a route handler that proxies requests to the fal API. * * This is a drop-in handler for Hono applications so that the client can be called * directly from the client-side code while keeping API keys safe. * * @param param the proxy options. * @returns a Hono route handler function. */ export declare function createRouteHandler({ resolveApiKey, }: FalHonoProxyOptions): RouteHandler; export {};