bubbledesk
v0.4.3
Published
Official JS/TS SDK for the Bubbledesk native bridge
Readme
Bubbledesk
This is the official JavaScript/TypeScript SDK for communicating with the native Bubbledesk bridge.
It allows any web application to access native desktop features exposed by the Bubbledesk wrapper, using a clean, typed, importable API.
If the app is running in a normal browser environment, the SDK provides a safe detection method isBubbledeskAvailable() so you can fallback.
Installation
npm install bubbledeskor
yarn add bubbledeskUsage
import { Bubbledesk, isBubbledeskAvailable } from "bubbledesk";
if (isBubbledeskAvailable()) {
await Bubbledesk.window.new();
} else {
console.log("Running in browser mode — native features unavailable.");
}API Shape
The SDK exposes TypeScript definitions for the entire bridge via BubbledeskAPI, ensuring autocomplete and type safety.
Detecting Native Environment
The SDK includes a lightweight helper:
isBubbledeskAvailable(): booleanIt never throws, even in SSR or when running outside Bubbledesk.
Useful for apps that must run both:
- as a normal website
- and as a desktop app wrapped with Bubbledesk
When Bubbledesk Is Not Available
If Bubbledesk is missing (e.g. browser mode), trying to call native APIs directly will throw.
Make sure to guard features or provide fallbacks:
if (!isBubbledeskAvailable()) return;
await Bubbledesk.window.new(...);