Modernizing the Fitbit Developer Experience.
The Fitbit Web APIs are moving to a new, scalable infrastructure. We will be deprecating the legacy Fitbit Web API in September 2026. To ensure uninterrupted data continuity for your users, you will need to migrate your applications. Detailed migration guides are live on the Google Health API developer site.
Haptics API
chevron down
 

Haptics API

Variable: vibration

Type: Vibration

The Haptics API allows developers to control the device's vibration motor.

import { vibration } from "haptics";
vibration.start("ring");

Interface: Vibration

Functions of the device's vibration motor.

Methods

start()

start(pattern: VibrationPatternName)

Returns: boolean

Start a vibration pattern by name.

Available patterns:

  • "alert"
  • "bump"
  • "confirmation"
  • "confirmation-max"
  • "nudge"
  • "nudge-max"
  • "ping"
  • "ring"

Parameter: pattern Name of a vibration pattern to play. See [VibrationPatternName].

Throws: Throws an Error if the name of the pattern is not a valid name.

stop()

Returns: void

Stop a playing vibration pattern.

If the vibration motor is currently playing a pattern, it will stop. It the vibration motor is not playing anything, this has no effect.

VibrationPatternName

String: "alert" | "bump" | "confirmation" | "confirmation-max" | "nudge" | "nudge-max" | "ping" | "ring"

List of all available vibration pattern names.