For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /apis/app/runtime/bff/use-hono-context.md.

useHonoContext

Used to obtain Hono context in an integrated BFF function.

Usage

import { useHonoContext } from '@modern-js/server-runtime';

Function Signature

function useHonoContext(): Context

Example

Developers can use context to obtain more request information, such as setting response headers:

import { useHonoContext } from '@modern-js/server-runtime';

export async function get() {
  const c = useHonoContext();
  c.res.headers.set('x-bff-api', 'true');
  // ...
}