/tap-web-sdk:tap-getting-startedfrom tap-web-sdk
First skill for any Tap web app. Call connect() from a button click, then register callbacks, then enable input. connect() starts notifications. There is no start(). Use for install, connect to my Tap, setup, or no tap events.
Ships in tap-web-sdk. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Works for both firmware classes. connect() returns TapSDKWeb (classic firmware) or TapSDKWeb2 (framed firmware). Write code that handles both unless the user says which device they have. Do not call these "SDK v1" or "SDK v2".
HID availability: Text mode, keyboard/mouse (HID) input, and setInputType work only on the standard firmware (TapSDKWeb: every Tap Strap, and TapXR by default); TapXR on the developer firmware (TapSDKWeb2, joined through the developer program) has no HID, so enable tap detection with setFeature(DeviceFeatures.MODEL_DETECTION, true) after connect().
Devices: Tap Strap, Tap Strap 2, TapXR. TapBand uses the same BLE API and is coming soon (waitlist). It is not for sale yet. Never describe it as unsupported, missing, or buyable. TapXR developer firmware supports the full gesture set (taps, thumb swipes, pinches with hold, fist with hold). Do not invent a firmware version number.
npm install @tapwithus/tapsdk
In this repository, build the bundle first:
npm install
npm run build
Browser notes:
connect() calls navigator.bluetooth.requestDevice(). Call it from a button click. The browser blocks the device picker without a user gesture.connect() first reconnects the Tap you last connected (a disconnected Tap does not show in the picker). For an app with its own UI, add a "Choose device" button that calls connect({ reuseKnownDevice: false }). connect({ device }) and connectToDevice(device) skip the picker for a specific BluetoothDevice.Copy the Connect and Choose device pattern from tap-build-an-app ("Connect button and reconnect"). In short: disable both buttons while connect() runs, re-enable them on error and on disconnect, and do not add a reload-time Reconnect button.
Open scripts/quickstart.html from this repository with a local static server after npm run build. In an app, use the same order with import { ... } from '@tapwithus/tapsdk'.
const sdk = await connect() from a click handler. This attaches, detects firmware, and starts notifications. There is no start().connect() returns.TapSDKWeb: await sdk.setInputMode(new InputModeController()). It boots in Text mode, which types into the focused field and sends no tap events to the SDK.TapSDKWeb2: setFeature(DeviceFeatures.MODEL_DETECTION, true), then pick a vision model (see the tap-vision-models skill).| Callback | TapSDKWeb | TapSDKWeb2 |
|---|---|---|
registerTapEvents | cb(identifier, tapcode: number) | cb(identifier, [tapcode]) |
registerAirGestureEvents | cb(identifier, gesture: number) (AirGestures) | cb(identifier, [code]) (UnifiedAirGestures) |
registerConnectionEvents | cb(sdk) | cb(serial: string) |
registerDisconnectionEvents | cb(identifier) | cb(identifier) |
| mouse / motion | registerMouseEvents: cb(id, vx, vy, proximity) | registerImuMotionDataEvents: cb(id, [dx, dy, isMouse, [roll, pitch, yaw]]) |
Normalize with:
function first(value: number | number[]): number {
return Array.isArray(value) ? value[0] : value;
}
Check the class with isTapSDKWeb2(sdk).
void sdk.sendVibrationSequence([80]), or put the event on a queue and handle it in requestAnimationFrame (see tap-build-an-app).sendVibrationSequence([onMs, offMs, onMs, ...]) gives haptic feedback (10-2550 ms per value, up to 18 values).await sdk.getDeviceInfo() reads the name, firmware, and battery.| Problem | Fix |
|---|---|
| Device picker does not open | Call connect() from a button click. Use Chrome or Edge on HTTPS or localhost. |
| No device in the picker | Turn the Tap on. Close Tap Manager and other apps that hold the connection. Then retry. |
| Paired Tap missing from the picker after disconnect | The Tap is still connected to the OS and does not advertise. In the same page, call connect() again: it reuses the last Tap of this session. After a reload this cannot work (getDevices() Taps fail with "no longer in range"): the user disconnects the Tap in system Bluetooth settings or resets it, then uses the picker. connect({ reuseKnownDevice: false }) always opens the picker; connectToDevice(device) connects a specific one. |
getPermittedDevices() is empty or getDevices is not a function | navigator.bluetooth.getDevices() is missing unless a flag is on: Chrome chrome://flags/#enable-experimental-web-platform-features, Edge edge://flags/#enable-experimental-web-platform-features (then relaunch). Without it getPermittedDevices() returns only this session's Taps. Feature-detect, never require it, and tell the user which flag if the list is empty. |
| User cancelled the picker | Catch the error and show it. Ask the user to click Connect again. |
Connected but no tap events (TapSDKWeb) | Call setInputMode(new InputModeController()) after you register callbacks. |
Connected but no tap events (TapSDKWeb2) | Enable MODEL_DETECTION and set the TAPPING model with TRIGGER op mode. |
| Letters appear in a text field when tapping | Device is in Text mode (TapSDKWeb). Set Controller mode. |
| GATT service missing | Turn Bluetooth off and on. Close other apps that use the Tap. Click Connect again. |
| Events stop | Keep the page open. Do not reload it. |
tap-tapping, tap-vision-models, tap-imu-motion, tap-raw-sensors, tap-knob, tap-dpad, tap-build-an-appWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub tapwithus/tap-web-sdk --plugin tap-web-sdkOther plugins' skills for the same job
8 skills in this plugin
/tap-build-an-appBuild a complete browser app or interactive experience controlled by a Tap - games, pages, presentations, or creative tools. Use when the user asks to build, make, or create something with their Tap, especially if they are not a developer./tap-dpadBuild a D-Pad style controller with TapSDKWeb2 - swipes for directions, short pinches to select, pinch-hold that locks into rotate (twist) or drag (move) mode, fist-hold to hide. Use for D-Pad, menu navigation, select and move, drag and drop, rotate objects, or game controls with gestures./tap-imu-motionUse Tap hand motion - TapSDKWeb2 IMU motion data (dx, dy, roll, pitch, yaw) and TapSDKWeb mouse events - to move a cursor, steer, tilt, or rotate things. Use for air mouse, pointer, cursor control, tilt, orientation, euler angles, roll/pitch/yaw, or motion-driven UI.