Support for the legacy Fitbit Web API ends on September 30, 2026
Important: Support for the legacy Fitbit Web API ends on September 30, 2026. After this date the API will continue to operate, but Google will no longer fix bugs or provide API support. On October 30, 2026, the Fitbit Web API will be turned off and will no longer function or sync data to or from Fitbit users. To continue accessing data for your users after this date, migrate to the Google Health API.
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.