Device API
chevron down
 

Device API

Variable: me

Type: Device

The Device API provides information about the device where the application is running.

import { me as device } from "device";
console.log(`Type:             ${device.type}`);
console.log(`Model name:       ${device.modelName}`);
console.log(`Model ID:         ${device.modelId}`);
console.log(`Body color:       ${device.bodyColor}`);
console.log(`Firmware version: ${device.firmwareVersion}`);
console.log(`Last synced:      ${device.lastSyncTime}`);

Interface: Device

The Device API provides information about the device where the application is running.

Properties

readonly bodyColor

string or undefined

New in SDK 3.0

The primary color of the device body. Returns a name for the color that most represents the device. The color name does not necessarily match up with SVG color names. Example: silver

Below is a table of platforms with their possible color values.

modelId alias modelName bodyColor
27 higgs Ionic undefined
32 meson Versa black
graphite
rose-gold
silver
38 gemini Versa Lite marina-blue
mulberry
silver
35 mira Versa 2 carbon
copper-rose
mist-grey
36 atlas Versa 3 onyx-black
pale-yellow-gold
platinum
44 vulcan Sense graphite
pale-yellow-gold
platinum

NOTE: Returns undefined for devices that are not aware of their own color (e.g. Ionic).

readonly firmwareVersion

string

Version of the device firmware. Usually represented as X.Y.Z.A where X, Y, Z, and A are integers. In all cases, X represents the modelId of the device.

Fitbit OS releases correspond to the following firmware versions:

  • Fitbit OS 1.2 - X.31.1.29
  • Fitbit OS 2.0 - X.32.4.19
  • Fitbit OS 2.1 - X.32.10.15
  • Fitbit OS 2.1.1 - X.32.10.20
  • Fitbit OS 2.2 - X.32.12.19
  • Fitbit OS 3.0 - X.33.1.30
  • Fitbit OS 4.0 - X.68.9.15
  • Fitbit OS 4.1 - X.70.7.14
  • Fitbit OS 4.2 - X.71.6.19
  • Fitbit OS 5.0 - X.128.1.42
readonly lastSyncTime

Date

Time at which the device was last sync'ed.

readonly modelId

string

Device model identifier. Developer-facing device model ID.

NOTE: the model identifier is always the same for a given device, even when the model name may change.

readonly modelName

string

Device model name. User-facing device model name as displayed in the Fitbit mobile application. Example: Ionic

NOTE: the model name may change over time for a given device as it may be different before and after a device is released commercially. Once a device is released commercially, the model name remains the same.

readonly screen

{ readonly width: number; readonly height: number; }

Device screen information.

readonly type

string

Device type. Standard device types include WATCH for smart watches and TRACKER for trackers.