Guides
Call APIFuse from server-side Next.js App Router code.
Use APIFuse from server-side App Router code. Keep APIFuse API keys in server-only configuration and return application-specific data to client components.
Use the operation schema or a schema bundle artifact to validate incoming request data before calling APIFuse.
import { NextResponse } from "next/server";
export async function POST(request: Request) {
const input = await request.json();
const response = await fetch(
"https://api.apifuse.com/v1/kakaomap/search",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.APIFUSE_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify(input),
cache: "no-store",
},
);
if (!response.ok) {
return NextResponse.json(
{ error: "apifuse_request_failed" },
{ status: response.status },
);
}
return NextResponse.json(await response.json());
}Do not expose APIFuse API keys, provider credentials, or Connection IDs to browser code. Client components should call your application route, not the APIFuse gateway directly.