> For AI agents: the complete documentation index is available at /zh/llms.txt, the full documentation bundle is available at /zh/llms-full.txt.

# useHonoContext

用于在一体化 BFF 函数中获取 Hono 上下文。

## 使用姿势

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

## 函数签名

`function useHonoContext(): Context`

## 示例

开发者可以通过 `context` 获取更多的请求信息，例如设置响应头：

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

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