-
-
Notifications
You must be signed in to change notification settings - Fork 261
IServerRendererItem
David Ortner edited this page Sep 23, 2025
·
1 revision
IServerRendererItem represents a single item to be rendered by the ServerRenderer.
interface IServerRendererItemimport { ServerRenderer } from "@happy-dom/server-renderer";
import type { IServerRendererItem } from "@happy-dom/server-renderer";
const renderer = new ServerRenderer();
const results = await renderer.render([
<IServerRendererItem>{ url: "https://example.com" },
]);
// The rendered HTML
console.log(results[0].url);
console.log(results[0].content);| Property | Type | Default | Description |
|---|---|---|---|
| url | string | The URL to render. | |
| outputFile? | string | The file path to save the rendered HTML. If not provided, the HTML will not be saved to a file and returned in the result instead. | |
| headers? | string[][] | { [key: string]: string } | Optional headers to include in the request. |
Help Packages