# Browser hosts

## Providers

| Path | Provider | Host support |
| --- | --- | --- |
| Browser Definitions and actions | Cloudflare Browser Run | Cloudflare preset only. `browser: true` with another preset fails the build. |
| `createBrowser()` with `cloudflareBrowser()` | Cloudflare Browser Run | Cloudflare Workers with a Browser binding. |
| `createBrowser()` with `localBrowser()` | Local Chromium | Trusted Node hosts. `browser: true` never picks it. |

The Cloudflare preset writes the Browser Run binding, a default `compatibility_date`, and the `nodejs_compat` flag to the generated `wrangler.json`. `vitehub()` and `hubBrowser()` keep your other Wrangler fields.

The Cloudflare Worker `quickAction()` needs remote mode in local development. Set `remote: true` so local Wrangler can call Browser Run. This needs a Cloudflare account and network access.

With `engine: 'chromium'`, install `@cloudflare/playwright` and `playwright-core`. Stateless actions and the default Kitesurf engine do not need them.

## Builds without Browser

An app that deploys to several hosts can import Browser on all of them. A build without Browser still builds, but calls fail with `BROWSER_UNAVAILABLE`. The message names the preset, the reason, and the fix. Call `isBrowserAvailable()` first to branch:

```ts [server/api/example-html.get.ts]
import { defineEventHandler } from 'h3'
import { isBrowserAvailable, runBrowserContent } from 'vite-hub/browser'

export default defineEventHandler(async () => {
  if (!isBrowserAvailable()) return { html: null }
  return { html: await runBrowserContent('https://example.com') }
})
```

`isBrowserAvailable()` reads the build, not the provider. It returns `true` in a build with `browser: true`, even when the binding is missing at runtime.

## Related guides

Read [Cloudflare Browser Run](https://vitehub.dev/docs/guides/cloudflare-browser) for binding setup and a rendered HTML check.

<!-- vitehub-docs:section-links -->
## In this section

- [Overview](https://vitehub.dev/raw/docs/browser.md)
- [Get started](https://vitehub.dev/raw/docs/browser/get-started.md)
- [Configure](https://vitehub.dev/raw/docs/browser/configure.md)
- [Server API](https://vitehub.dev/raw/docs/browser/server-api.md)
- [Agent capability](https://vitehub.dev/raw/docs/browser/agent-capability.md)
- [Hosts](https://vitehub.dev/raw/docs/browser/hosts.md) (this page)
- [Limits and errors](https://vitehub.dev/raw/docs/browser/limits-and-errors.md)

Next: [BROWSER_R0007](https://vitehub.dev/raw/docs/browser/diagnostics/browser_r0007.md)

All pages: [llms.txt](https://vitehub.dev/llms.txt)
