npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@wklm/detect

v0.1.1

Published

Detect WebBLE Safari extension on iOS. Auto-show install banner when extension not found

Downloads

226

Readme

@wklm/detect

Detect the iOSWebBLE Safari extension on iOS. Auto-show an install banner when the extension is not found. No-op on all other platforms.

Install

npm install @wklm/detect

Usage

import { initIOSWebBLE } from '@wklm/detect';

await initIOSWebBLE({
  operatorName: 'FitTracker',
  banner: { mode: 'sheet', dismissDays: 14 },
  onReady: () => console.log('Extension active'),
  onNotInstalled: () => console.log('Prompting install'),
});

For React/Next.js:

import { IOSWebBLEProvider } from '@wklm/detect/react';

export default function Layout({ children }) {
  return <IOSWebBLEProvider>{children}</IOSWebBLEProvider>;
}

For plain HTML (no bundler):

<script src="https://ioswebble.com/webble.js"></script>

Standalone usage (no React, no profiles)

You can use @wklm/detect with @wklm/core only -- no React, no profiles package needed. Together they are ~6KB gzipped.

import { initIOSWebBLE, isIOSSafari } from '@wklm/detect';
import { WebBLE, WebBLEError } from '@wklm/core';

// 1. On iOS Safari, detect the extension and prompt install if missing
if (isIOSSafari()) {
  await initIOSWebBLE({
    operatorName: 'MyApp',
    banner: { mode: 'sheet' },
    onReady: () => console.log('Extension ready'),
    onNotInstalled: () => {
      // Banner is shown automatically; you can also add custom handling here
      console.log('Extension not installed -- banner shown');
    },
  });
}

// 2. Scan and connect (works on iOS Safari + Chrome + Edge)
const ble = new WebBLE();
try {
  const device = await ble.requestDevice({
    filters: [{ services: ['heart_rate'] }],
  });
  await device.connect();
  const value = await device.read('heart_rate', 'heart_rate_measurement');
  console.log('Heart rate:', value.getUint8(1));
  await device.disconnect();
} catch (err) {
  if (err instanceof WebBLEError) {
    console.error(err.code, err.suggestion);
  }
}

What each package provides

| Package | Purpose | Size | |---------|---------|------| | @wklm/core | BLE scanning, connecting, GATT read/write/subscribe | ~4KB gzip | | @wklm/detect | iOS extension detection + install banner | ~2KB gzip | | @wklm/profiles | Typed BLE profiles (heart rate, battery, etc.) | Optional | | @wklm/react-sdk | React hooks (useDevice, useCharacteristic) | Optional |

API

  • initIOSWebBLE(options) -- detect extension, show banner, fire callbacks
  • isIOSSafari() -- returns true on iOS Safari
  • isExtensionInstalled() -- async check for the extension marker
  • showInstallBanner(options) / removeInstallBanner() -- manual banner control

initIOSWebBLE options

| Option | Type | Description | |--------|------|-------------| | key | string | Optional API key for analytics | | operatorName | string | Your app name (shown in install banner) | | banner.mode | 'sheet' \| 'bar' | Banner display style | | banner.position | string | Banner position | | banner.text | string | Custom banner text | | banner.buttonText | string | Custom button label | | banner.appStoreUrl | string | Override App Store link | | banner.dismissDays | number | Days before banner re-appears after dismiss | | banner.style | object | Custom CSS styles | | onReady | () => void | Called when extension is detected and active | | onNotInstalled | () => void | Called when extension is not found |

AI agent integration

MCP server for coding agents (Claude Code, Cursor, Copilot):

npx -y @wklm/mcp

Full SDK reference for LLM context: https://ioswebble.com/llms-full.txt

Two scopes

The @wklm/* packages (core, profiles, react) are the cross-browser BLE SDK -- they work on any platform with Web Bluetooth support (Chrome, Edge, iOS Safari via the extension). The @wklm/* packages (detect, cli, mcp, skill) handle iOS-specific extension detection, install prompts, and agent tooling. Use both together for full iOS Safari coverage.