# ContextRenderer

**Kind:** Interface

**Source:** [`src/context.ts`](https://github.com/honojs/hono/blob/main/src/context.ts#L62)

Interface for context renderer.

`ContextRenderer` defines the contract for converting context data into rendered output. Implementations receive context from the surrounding system and return the representation consumed by the next stage.

## Diagram

```mermaid
graph LR
  Context[Context data] --> Renderer[ContextRenderer]
  Renderer --> Output[Rendered output]
```

## Usage

```ts
import type { ContextRenderer } from "./context";

const renderer: ContextRenderer = {
  render(context) {
    return JSON.stringify(context);
  },
};

const renderedContext = renderer.render({
  user: "Ada",
  action: "create",
});

console.log(renderedContext);
```

## AI Coding Instructions

- Implement the `render` method required by `ContextRenderer`.
- Keep rendering logic focused on transforming the received context into output.
- Do not mutate the input context while rendering.
- Pass renderer implementations through the integration point that consumes rendered context.
