Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Overview

The HTML Widget embeds a fully custom HTML + JavaScript page in a Blynk dashboard as a first-class widget. The page runs inside a Blynk host that exposes a JavaScript bridge, BlynkBridge. Through it your page can read and write datastream values, react to real-time updates, show the bound device's info and image, work with device metadata, tags, files, events, Data Engine queries and key-value storage, follow the app theme, and navigate to dashboard pages and native screens. No server-side code is needed.

Two kinds of host implement the bridge, and they are not identical:

Host
Transport
Bridge script

Web — Blynk Console dashboard

A sandboxed <iframe> that talks to the dashboard with window.postMessage

Injected before your page's scripts

Mobile — Blynk Android and iOS apps

A native WebView with a JavaScript interface

Injected before your page's scripts

Capability flags, permission names and a few validation limits differ between the two. Each method entry notes its differences, and Platform Differences collects them in one place. Never assume web behavior on mobile or the other way round — check the capability methods and feature-detect at runtime.

Generating widgets with AI

Blynk publishes blynk-html-widget, an Agent Skill that teaches an AI coding agent how to build HTML widgets. It carries the BlynkBridge API reference, the platform constraints, and Blynk's visual style, so the agent produces a widget that works instead of guessing at the bridge.

  1. Download the skill below.

  2. Add it to your AI tool. The way to add depends on the exact tool.

  3. Describe what you need in plain language: "a gauge showing the temperature datastream with a 24-hour chart underneath" and optionally send a screenshot reference if you have to get more precise result.

  4. Copy the generated HTML into the editor's Code tab, then verify it on the Testing tab against a real device.

How this reference is organized

The guide follows the layout of the Blynk Platform API reference: a getting-started part, then one page per area of the bridge, with one entry per method. Every method entry has the same parts:

  • a one-line summary,

  • the call signature,

  • Parameters — name, type, whether it is required, and what it means,

  • Resolves with — the value of a successful call,

  • Rejects with — the BlynkBridgeError codes the call can fail with,

  • an Example, and notes where the hosts differ.

Page
Methods

How it works, skeleton, new BlynkBridge(), boot sequence

isBridgeAvailable, isExternalRequestsAllowed, isRangePickerSupported, isPageActionsSupported

getValue, getValues, sendValue, datastream selectors

getHistoricalData, getMapData

getDeviceInfo, device image, getDeviceTags

getAllDeviceMetadata, getDeviceMetadata, updateDeviceMetadata

getDeviceFiles, getDeviceFile, getDeviceFileBlob, uploadDeviceFile, deleteDeviceFile, getAssets, getAsset, getAssetBlob

getDeviceEventsPermissions, getDeviceEvents, getDeviceEventComments, addDeviceEventComment, resolveDeviceEvent, archiveDeviceEvent, unarchiveDeviceEvent, createDeviceEventNote

executeDataEngineQuery

getStorageItem, setStorageItem, removeStorageItem, clearStorage

isPermissionAllowed, getUnitSystems

openDeviceInfo, openDeviceEvents, openAutomations, getPages, showPage, closePage, closeAllPages

getTheme, CSS custom properties, container queries

setCallbacks and the six callbacks

BlynkBridgeError, sendError, setOnErrorEnabled, log, setLogging, destroy

Web vs. mobile at a glance

Short rules worth remembering

Last updated

Was this helpful?