Migration Guide
chevron down
 

SDK Migration Guide

Overview

To ensure that your application continues to function correctly after upgrading the SDK version we have provided this migration guide to identify the breaking changes between each version of the SDK.

If you are jumping more than one SDK version when upgrading your application, you will need to check the changes in each version between your current and the latest SDK version.

SDK 2.0 to 3.0

When migrating your application from SDK 2.0 to SDK 3.0, you should be aware of the following changes to existing behavior:

  • BREAKING: Removed support for importing resources into components other than settings.
  • Added compressed .fba bundles.
  • BREAKING: Slight increase in overall memory usage, dependent upon usage:
    • appbit grew by 32 bytes.
    • device grew by 16 bytes.
    • document grew by 16 bytes.
    • file-transfer grew by 160 bytes.
    • heart-rate grew by 88 bytes.
    • jpeg grew by 32 bytes.
    • system grew by 16 bytes.

Please refer to the Fitbit OS 3.0 announcement blog post for full details of the new features and APIs introduced in SDK 3.0.

SDK 1.0 to 2.0

When migrating your application from SDK 1.0 to SDK 2.0, you should be aware of the following changes to existing behavior:

  • BREAKING: Applications will now automatically close after 2 minutes of inactivity, unless you override this behavior using the App Timeout API.
  • BREAKING: Removed JSON support for import. You can use a .js file import myObj from './myFile'.
  • BREAKING: Fixed a an issue where import paths were broken: import foo from 'foo' would import foo.js which did not make sense. Now you need to import foo from './foo'.
  • JavaScript bundle minification - with sourcemapping.
  • Added RGBA6666 image compression, so images with transparency are smaller than before.
  • The JPEG module now correctly throws an error when an image decode fails.
  • BREAKING: Vertical text alignment has been fixed, you may need to adjust any vertically aligned textarea and text elements.
  • The Geolocation API on Fitbit Versa now automatically falls back to Connected GPS mode.

Please refer to the Fitbit OS 2.2 announcement blog post for full details of the new features and APIs introduced in SDK 2.0.

Upgrade Process

In order to upgrade your project from one version to another, you should follow the steps outlined below. These vary depending if you're using Fitbit Studio or our Command Line SDK.

Fitbit Studio

To change your SDK version using Fitbit Studio you must:

  1. Open your project.
  2. Click on the package.json file.
  3. Select the latest SDK Version from the dropdown menu.
  4. Update your code by following the migration instructions above.
  5. Click Build to rebuild your project using the new SDK version.

Command Line SDK

To change your SDK version using the Command Line SDK you must:

  1. Set your project's SDK version by running one of the following commands:

npm users

npm install --save-dev @fitbit/sdk@~3.0.0

yarn users

yarn add --dev @fitbit/sdk@~3.0.0
  1. Update your code by following the migration instructions above.
  2. Then rebuild your project.

Note: Don't forget to set the correct version number in the sample commands above.