import { me as appbit } from 'appbit' ; import { minuteHistory , dayHistory } from 'user-activity' ; if ( appbit . permissions . granted ( 'access_activity' ) ) { const minuteRecords = minuteHistory . query ( { limit : 5 } ) ; minuteRecords . forEach ( ( minute , index ) => { console . log ( `${ minute . steps || 0 } steps. ${ index + 1 } minute(s) ago.` ) ; } ) ; const dayRecords = dayHistory . query ( ) ; dayRecords . forEach ( ( day , index ) => { console . log ( `${ day . steps || 0 } steps. ${ index + 1 } day(s) ago.` ) ; } ) ; }