> For the complete documentation index, see [llms.txt](https://docs.blynk.io/en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.blynk.io/en/html-widget-developer-guide/host-capabilities.md).

# Host Capabilities

Synchronous checks for what the current host supports. None of them makes a round trip.

| Method                        | Web                                | Mobile                               |
| ----------------------------- | ---------------------------------- | ------------------------------------ |
| `isBridgeAvailable()`         | `true` inside the dashboard iframe | `true` when the native bridge exists |
| `isExternalRequestsAllowed()` | `false`                            | `true`                               |
| `isRangePickerSupported()`    | `true`                             | `false`                              |
| `isPageActionsSupported()`    | `false`                            | `true`                               |

Feature-detect method families as well. Newer families — device tags, device files and assets, native screens — can be missing on an older host, so check the method before you build that part of the UI and leave it out when it's missing:

```js
const hasTags  = typeof bridge.getDeviceTags  === 'function';
const hasFiles = typeof bridge.getDeviceFiles === 'function';
```

### Check bridge availability

> Tells whether the page runs inside a Blynk host.

```js
bridge.isBridgeAvailable()  // → boolean
```

Returns `true` inside a Blynk host, and `false` in a plain browser tab or the HTML editor preview. Use it to render placeholder content so the widget still looks meaningful in the editor.

### Check external requests

> Tells whether widget JavaScript may make outbound HTTP requests.

```js
bridge.isExternalRequestsAllowed()  // → boolean
```

* **Web: always `false`.** The widget iframe has a null origin, so the browser blocks cross-origin requests no matter what your code does.
* **Mobile: always `true`.** Individual requests can still fail because of CORS or the network, so handle rejections.

```js
if (bridge.isExternalRequestsAllowed()) {
  fetch('https://api.example.com/data')
    .then(r => r.json())
    .then(renderData)
    .catch(err => bridge.log('Fetch failed: ' + err));
}
```

### Check range picker support

> Tells whether the `RANGE_PICKER` period is available for history and map data.

```js
bridge.isRangePickerSupported()  // → boolean
```

`true` on web, where the dashboard's own date-range picker drives the time window. `false` on mobile — there the widget draws its own period control and requests `CUSTOM` ranges. See [Historical & Map Data](https://docs.blynk.io/en/html-widget-developer-guide/historical-and-map-data.md).

### Check page actions support

> Tells whether dashboard-page navigation (`getPages`, `showPage`, `closePage`, `closeAllPages`) is available.

```js
bridge.isPageActionsSupported()  // → boolean
```

`true` on mobile, `false` on web, where those methods don't exist at all. It is a capability flag, not an authorization check. It does not apply to the native-screen methods (`openDeviceInfo` and friends), which work on both hosts. See [Navigation](https://docs.blynk.io/en/html-widget-developer-guide/navigation.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.blynk.io/en/html-widget-developer-guide/host-capabilities.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
