Fitbit SDK Types
Add types to your Fitbit project to use safely the SDK, work safely with TypeScript preventing you of doing stupid mistakes.
How to use in your app project
- Add this project as to your
devDependencies
with npm install --save-dev fitbit-sdk-types
. - Add a reference in your target folder's
tsconfig.json
file:
app/tsconfig.json
{
"extends": "../tsconfig.json",
"compilerOptions": {
"checkJs": true
},
"include": ["./", "../node_modules/fitbit-sdk-types/device"]
}
- And use it:
app/index.js
import { Accelerometer } from 'accelerometer';
const acc = new Accelerometer();
console.log(acc.activated);
console.log(acc.potato);
Examples
You can see a ton of official examples working as tests right here, under the ./test
path.
Contributing
Make a PR submitting at least the desired test examples to work under the .test
path, ideally with some link to any of the Fitbit official sources to get more info.