10-15-2017 18:33
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

10-15-2017 18:33
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I'm creating a watch face and was trying to include steps (and likely other device oriented api data). I saw a post on here about a similar issue, however i think my question may be based upon permissions possibly.
Here is a snippet:
import * as ua from "user-activity"; console.log(JSON.stringify(ua));
This is the output in the console:
[9:25:05 PM]{"today":{"local":{"adjusted":true},"adjusted":{"adjusted":true}},"goals":{}}
I'm not certain why there isn't more to this object. I've also ran a more specific import but with no better results:
import { today } from "user-activity"; console.log((today.local.steps || 0) + " steps");
Thanks in advance.
Answered! Go to the Best Answer.

Accepted Solutions
10-16-2017 16:09
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


10-16-2017 16:09
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
Try this:
import userActivity from "user-activity"; const metric = "steps"; // distance, calories, elevationGain, activeMinutes const amount = userActivity.today.local[metric] || 0;
console.log(amount);
10-16-2017 16:09
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


10-16-2017 16:09
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
Try this:
import userActivity from "user-activity"; const metric = "steps"; // distance, calories, elevationGain, activeMinutes const amount = userActivity.today.local[metric] || 0;
console.log(amount);
12-28-2017 12:41 - edited 12-28-2017 12:44
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

12-28-2017 12:41 - edited 12-28-2017 12:44
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
(Accidental Duplicate Message Removed)

12-28-2017 12:42
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

12-28-2017 12:42
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I know this issue was marked solved, but this solution seems to have stopped working on the latest firmware update?
I'm getting undefined with that exact code snippet for steps.
Or am I perhaps missing more imports or setup the fetch the step count from user-activity?

12-28-2017 12:48
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

12-28-2017 12:48
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
lol, feel a bit like an idiot, but to possibly assist someone else running into this issue of mine..
Go to the package.json and enable the "Activity" permission.
01-09-2018 12:56
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

01-09-2018 12:56
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Thank you!!!!! I couldn't figure that out for the longest time! I was seriously going crazy...

