capacitor-rook-sdk
v4.1.1
Published
Extract and sync information of Health Connect and Apple Health
Readme
capacitor-rook-sdk
Extract and sync information of Health Connect and Apple Health
Install
npm install capacitor-rook-sdk
npx cap syncRookStepsCounter
RookStepsCounter is the Android-only API for the native Rook steps counter.
Use it when you want to:
- Check whether the current Android device supports the Rook steps counter.
- Enable or disable the native step counter.
- Check whether the step counter is active.
- Read today's step count collected by the step counter.
Platform availability
RookStepsCounter is only available on Android.
It should not be called from iOS code paths.
For shared Ionic or Capacitor apps, guard access with a platform check:
import { Capacitor } from '@capacitor/core';
import { RookStepsCounter } from 'capacitor-rook-sdk';
const isAndroid = Capacitor.getPlatform() === 'android';
if (isAndroid) {
const availability = await RookStepsCounter.isRookStepsCounterAvailable();
console.log(availability.result);
}Prerequisite
Initialize Rook before using this object. If Rook has not been initialized, the native Android layer rejects the call with an initialization error.
import { RookConfig } from 'capacitor-rook-sdk';
await RookConfig.initRook({
clientUUID: 'YOUR_CLIENT_UUID',
secret: 'YOUR_SECRET_KEY',
environment: 'sandbox',
});Recommended flow
- Verify that the app is running on Android.
- Initialize Rook with
RookConfig.initRook(...). - Call
RookStepsCounter.isRookStepsCounterAvailable()before showing step-counter actions in the UI. - Enable the counter with
RookStepsCounter.enableRookStepsCounter(). - Confirm the current status with
RookStepsCounter.isRookStepsCounterActive(). - Read today's steps with
RookStepsCounter.getRookTodayStepsCount(). - Disable the counter with
RookStepsCounter.disableRookStepsCounter()when needed.
API reference
isRookStepsCounterAvailable()
Returns a BoolResult with the shape { result: boolean }.
true: the current Android device supports the Rook steps counter.false: the steps counter is not available on this device.
isRookStepsCounterActive()
Returns a BoolResult with the shape { result: boolean }.
true: the steps counter is currently enabled.false: the steps counter is currently disabled.
enableRookStepsCounter()
Enables the native Rook steps counter and returns a BoolResult.
true: the enable operation succeeded.false: the enable operation did not succeed.
disableRookStepsCounter()
Disables the native Rook steps counter and returns a BoolResult.
true: the disable operation succeeded.false: the disable operation did not succeed.
getRookTodayStepsCount()
Returns a StepsResult with the shape { stepCount: number }.
The stepCount value is today's total steps reported by the native Rook steps counter.
Example
import { Capacitor } from '@capacitor/core';
import { RookConfig, RookStepsCounter } from 'capacitor-rook-sdk';
async function setupStepsCounter() {
if (Capacitor.getPlatform() !== 'android') return;
await RookConfig.initRook({
clientUUID: 'YOUR_CLIENT_UUID',
secret: 'YOUR_SECRET_KEY',
environment: 'sandbox',
});
const availability = await RookStepsCounter.isRookStepsCounterAvailable();
if (!availability.result) {
return;
}
await RookStepsCounter.enableRookStepsCounter();
const active = await RookStepsCounter.isRookStepsCounterActive();
const todaySteps = await RookStepsCounter.getRookTodayStepsCount();
console.log('Steps counter active:', active.result);
console.log('Today steps:', todaySteps.stepCount);
}Migration from deprecated Health Connect step methods
If you are still using step methods from RookHealthConnect, migrate to RookStepsCounter:
| Deprecated method | Use instead |
| --- | --- |
| RookHealthConnect.syncTodayAndroidStepsCount() | RookStepsCounter.getRookTodayStepsCount() |
| RookHealthConnect.enableBackgroundAndroidSteps() | RookStepsCounter.enableRookStepsCounter() |
| RookHealthConnect.disableBackgroundAndroidSteps() | RookStepsCounter.disableRookStepsCounter() |
| RookHealthConnect.isBackgroundAndroidStepsActive() | RookStepsCounter.isRookStepsCounterActive() |
Notes for other developers
- Prefer
RookStepsCounterfor Android step-counter features instead of the deprecatedRookHealthConnectstep methods. - Check availability before enabling the feature, since support can vary by device.
- Keep Android guards close to the call site in shared codebases to avoid accidental iOS calls.
API
writeNutritionEvent(...)addListener(EventNames, ...)addListener('io.tryrook.background.appleHealth.errors', ...)- Interfaces
- Type Aliases
writeNutritionEvent(...)
writeNutritionEvent(props: NutritionEventProps) => Promise<BoolResult>| Param | Type |
| ----------- | ------------------------------------------------------------------- |
| props | NutritionEventProps |
Returns: Promise<BoolResult>
addListener(EventNames, ...)
addListener(eventName: EventNames, callback: (info: any) => void) => Promise<PluginListenerHandle>| Param | Type |
| --------------- | ------------------------------------------------- |
| eventName | EventNames |
| callback | (info: any) => void |
Returns: Promise<PluginListenerHandle>
addListener('io.tryrook.background.appleHealth.errors', ...)
addListener(eventName: AppleEventNames, callback: (info: any) => void) => Promise<PluginListenerHandle>| Param | Type |
| --------------- | ------------------------------------------------------- |
| eventName | 'io.tryrook.background.appleHealth.errors' |
| callback | (info: any) => void |
Returns: Promise<PluginListenerHandle>
Interfaces
PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove | () => Promise<void> |
Array
| Prop | Type | Description |
| ------------ | ------------------- | ------------------------------------------------------------------------------------------------------ |
| length | number | Gets or sets the length of the array. This is a number one higher than the highest index in the array. |
| Method | Signature | Description | | ------------------ | ----------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | toString | () => string | Returns a string representation of an array. | | toLocaleString | () => string | Returns a string representation of an array. The elements are converted to string using their toLocalString methods. | | pop | () => T | undefined | Removes the last element from an array and returns it. If the array is empty, undefined is returned and the array is not modified. | | push | (...items: T[]) => number | Appends new elements to the end of an array, and returns the new length of the array. | | concat | (...items: ConcatArray<T>[]) => T[] | Combines two or more arrays. This method returns a new array without modifying any existing arrays. | | concat | (...items: (T | ConcatArray<T>)[]) => T[] | Combines two or more arrays. This method returns a new array without modifying any existing arrays. | | join | (separator?: string | undefined) => string | Adds all the elements of an array into a string, separated by the specified separator string. | | reverse | () => T[] | Reverses the elements in an array in place. This method mutates the array and returns a reference to the same array. | | shift | () => T | undefined | Removes the first element from an array and returns it. If the array is empty, undefined is returned and the array is not modified. | | slice | (start?: number | undefined, end?: number | undefined) => T[] | Returns a copy of a section of an array. For both start and end, a negative index can be used to indicate an offset from the end of the array. For example, -2 refers to the second to last element of the array. | | sort | (compareFn?: ((a: T, b: T) => number) | undefined) => this | Sorts an array in place. This method mutates the array and returns a reference to the same array. | | splice | (start: number, deleteCount?: number | undefined) => T[] | Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. | | splice | (start: number, deleteCount: number, ...items: T[]) => T[] | Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. | | unshift | (...items: T[]) => number | Inserts new elements at the start of an array, and returns the new length of the array. | | indexOf | (searchElement: T, fromIndex?: number | undefined) => number | Returns the index of the first occurrence of a value in an array, or -1 if it is not present. | | lastIndexOf | (searchElement: T, fromIndex?: number | undefined) => number | Returns the index of the last occurrence of a specified value in an array, or -1 if it is not present. | | every | <S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any) => this is S[] | Determines whether all the members of an array satisfy the specified test. | | every | (predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any) => boolean | Determines whether all the members of an array satisfy the specified test. | | some | (predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any) => boolean | Determines whether the specified callback function returns true for any element of an array. | | forEach | (callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any) => void | Performs the specified action for each element in an array. | | map | <U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any) => U[] | Calls a defined callback function on each element of an array, and returns an array that contains the results. | | filter | <S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any) => S[] | Returns the elements of an array that meet the condition specified in a callback function. | | filter | (predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any) => T[] | Returns the elements of an array that meet the condition specified in a callback function. | | reduce | (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T) => T | Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. | | reduce | (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T) => T | | | reduce | <U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U) => U | Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. | | reduceRight | (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T) => T | Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. | | reduceRight | (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T) => T | | | reduceRight | <U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U) => U | Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. |
ConcatArray
| Prop | Type |
| ------------ | ------------------- |
| length | number |
| Method | Signature | | --------- | ------------------------------------------------------------------ | | join | (separator?: string | undefined) => string | | slice | (start?: number | undefined, end?: number | undefined) => T[] |
String
Allows manipulation and formatting of text strings and determination and location of substrings within strings.
| Prop | Type | Description |
| ------------ | ------------------- | ------------------------------------------------------------ |
| length | number | Returns the length of a String object. |
| Method | Signature | Description | | --------------------- | ------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- | | toString | () => string | Returns a string representation of a string. | | charAt | (pos: number) => string | Returns the character at the specified index. | | charCodeAt | (index: number) => number | Returns the Unicode value of the character at the specified location. | | concat | (...strings: string[]) => string | Returns a string that contains the concatenation of two or more strings. | | indexOf | (searchString: string, position?: number | undefined) => number | Returns the position of the first occurrence of a substring. | | lastIndexOf | (searchString: string, position?: number | undefined) => number | Returns the last occurrence of a substring in the string. | | localeCompare | (that: string) => number | Determines whether two strings are equivalent in the current locale. | | match | (regexp: string | RegExp) => RegExpMatchArray | null | Matches a string with a regular expression, and returns an array containing the results of that search. | | replace | (searchValue: string | RegExp, replaceValue: string) => string | Replaces text in a string, using a regular expression or search string. | | replace | (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string) => string | Replaces text in a string, using a regular expression or search string. | | search | (regexp: string | RegExp) => number | Finds the first substring match in a regular expression search. | | slice | (start?: number | undefined, end?: number | undefined) => string | Returns a section of a string. | | split | (separator: string | RegExp, limit?: number | undefined) => string[] | Split a string into substrings using the specified separator and return them as an array. | | substring | (start: number, end?: number | undefined) => string | Returns the substring at the specified location within a String object. | | toLowerCase | () => string | Converts all the alphabetic characters in a string to lowercase. | | toLocaleLowerCase | (locales?: string | string[] | undefined) => string | Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. | | toUpperCase | () => string | Converts all the alphabetic characters in a string to uppercase. | | toLocaleUpperCase | (locales?: string | string[] | undefined) => string | Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. | | trim | () => string | Removes the leading and trailing white space and line terminator characters from a string. | | substr | (from: number, length?: number | undefined) => string | Gets a substring beginning at the specified location and having the specified length. | | valueOf | () => string | Returns the primitive value of the specified object. |
RegExpMatchArray
| Prop | Type |
| ----------- | ------------------- |
| index | number |
| input | string |
RegExp
| Prop | Type | Description |
| ---------------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| source | string | Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. |
| global | boolean | Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. |
| ignoreCase | boolean | Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. |
| multiline | boolean | Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. |
| lastIndex | number | |
| Method | Signature | Description | | ----------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | | exec | (string: string) => RegExpExecArray | null | Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search. | | test | (string: string) => boolean | Returns a Boolean value that indicates whether or not a pattern exists in a searched string. | | compile | () => this | |
RegExpExecArray
| Prop | Type |
| ----------- | ------------------- |
| index | number |
| input | string |
Type Aliases
BoolResult
{ result: boolean; }
NutritionEventProps
{ event: NutritionEvent; }
NutritionEvent
{ name: string; quantity: NutritionInsertionEventQuantity; date: string; type: HCNutritionInsertionType; nutritionInsertionEnergyWaterDataRelated?: NutritionInsertionEnergyWaterDataRelated | null; nutritionCarbohydratesDataRelated?: NutritionCarbohydratesDataRelated | null; nutritionFatsDataRelated?: NutritionFatsDataRelated | null; nutritionProteinDataRelated?: NutritionProteinDataRelated | null; nutritionVitaminsDataRelated?: NutritionVitaminsDataRelated | null; nutritionMineralDataRelated?: NutritionMineralDataRelated | null; }
NutritionInsertionEventQuantity
{ unit: number; amount: number; }
HCNutritionInsertionType
'BREAKFAST' | 'LUNCH' | 'DINNER' | 'SNACK'
NutritionInsertionEnergyWaterDataRelated
{ dietaryKiloCaloriesEnergyConsumed?: number | null; dietaryKiloCaloriesEnergyFromFat?: number | null dietaryMilliLiterWater?: number | null; }
NutritionCarbohydratesDataRelated
{ dietaryGramCarbohydrates?: number | null; dietaryGramFiber?: number | null; dietaryGramSugar?: number | null; dietaryGramCaffeine?: number | null; }
NutritionFatsDataRelated
{ dietaryGramFatTotal?: number | null; dietaryGramFatSaturated?: number | null; dietaryGramFatMonounsaturated?: number | null; dietaryGramFatPolyunsaturated?: number | null; dietaryGramTransFat?: number | null; dietaryUnsaturatedFat?: number | null; }
NutritionProteinDataRelated
{ dietaryGramProtein?: number | null; dietaryMilliGramCholesterol?: number | null; }
NutritionVitaminsDataRelated
{ dietaryMicroGramVitaminA?: number | null; dietaryMilliGramVitaminB6?: number | null; dietaryMicroGramVitaminB12?: number | null; dietaryMilliGramVitaminC?: number | null; dietaryMicroGramVitaminD?: number | null; dietaryMilliGramVitaminE?: number | null; dietaryMicroGramVitaminK?: number | null; dietaryMilliGramThiamin?: number | null; dietaryMilliGramRiboflavin?: number | null; dietaryMilliGramNiacin?: number | null; dietaryMilliGramPantothenicAcid?: number | null; dietaryMicroGramFolate?: number | null; dietaryMicroGramBiotin?: number | null; dietaryGramFolicAcid?: number | null; }
NutritionMineralDataRelated
{ dietaryMilliGramsCalcium?: number | null; dietaryMilliGramsChloride?: number | null; dietaryMilliGramsChromium?: number | null; dietaryMilliGramsCopper?: number | null; dietaryMilliGramsIodine?: number | null; dietaryMilliGramsIron?: number | null; dietaryMilliGramsMagnesium?: number | null; dietaryMilliGramsManganese?: number | null; dietaryMilliGramsMolybdenum?: number | null; dietaryMilliGramsPhosphorus?: number | null; dietaryMilliGramsPotassium?: number | null; dietaryMilliGramsSelenium?: number | null; dietaryMilliGramsSodium?: number | null; dietaryMilliGramsZinc?: number | null; }
EventNames
'io.tryrook.permissions.android' | 'io.tryrook.permissions.healthConnect'
AppleEventNames
'io.tryrook.background.appleHealth.errors'
InitRookProps
{ environment: Environment; clientUUID: string; secret: string; bundleId?: string; packageName?: string; enableBackgroundSync: boolean; enableEventsBackgroundSync: boolean; enableLogs?: boolean; }
Environment
'production' | 'sandbox'
DiagnosticProps
{ androidSource: HealthKitSourceType }
HealthKitSourceType
'HEALTH_CONNECT' | 'SAMSUNG'
SDKDiagnoticResult
{ result: SDKDiagnotic; }
SDKDiagnotic
{ isConfigured: boolean; userIdentified: boolean; permissions: string backgroundSync: SDKBackgroundDiagnostic manualSync: SDKManualSyncState }
SDKBackgroundDiagnostic
{ enabled: boolean lastSync?: string }
SDKManualSyncState
{ enabled: boolean lastSync?: string }
UpdateUserIdProps
{ userId: string; }
UserIdResult
{ userId: string; }
CheckAvailabilityResult
{ result: CheckAvailabilityResponse; }
CheckAvailabilityResponse
'INSTALLED' | 'NOT_INSTALLED' | 'NOT_SUPPORTED'
StringResult
{ result: string; }
PermissionTypePromps
{ types?: Array<AppleHealthPermissionType>; }
AppleHealthPermissionType
'appleExerciseTime' | 'appleMoveTime' | 'appleStandTime' | 'basalEnergyBurned' | 'activeEnergyBurned' | 'stepCount' | 'distanceCycling' | 'distanceWalkingRunning' | 'distanceSwimming' | 'swimmingStrokeCount' | 'flightsClimbed' | 'walkingSpeed' | 'walkingStepLength' | 'runningPower' | 'runningSpeed' | 'stairAscentSpeed' | 'cyclingPower' | 'cyclingSpeed' | 'waterTemperature' | 'height' | 'bodyMass' | 'bodyMassIndex' | 'waistCircumference' | 'bodyFatPercentage' | 'bodyTemperature' | 'basalBodyTemperature' | 'appleSleepingWristTemperature' | 'heartRate' | 'restingHeartRate' | 'walkingHeartRateAverage' | 'heartRateVariabilitySDNN' | 'electrocardiogram' | 'workout' | 'workoutRoute' | 'sleepAnalysis' | 'sleepApneaEvent' | 'vo2Max' | 'oxygenSaturation' | 'respiratoryRate' | 'uvExposure' | 'biologicalSex' | 'dateOfBirth' | 'bloodPressureSystolic' | 'bloodPressureDiastolic' | 'bloodGlucose' | 'dietaryEnergyConsumed' | 'dietaryProtein' | 'dietarySugar' | 'dietaryFatTotal' | 'dietaryCarbohydrates' | 'dietaryFiber' | 'dietarySodium' | 'dietaryCholesterol' | 'dietaryBiotin' | 'dietaryCaffeine' | 'dietaryCalcium' | 'dietaryChloride' | 'dietaryChromium' | 'dietaryCopper' | 'dietaryFatMonounsaturated' | 'dietaryFatPolyunsaturated' | 'dietaryFatSaturated' | 'dietaryFolate' | 'dietaryIodine' | 'dietaryIron' | 'dietaryMagnesium' | 'dietaryManganese' | 'dietaryMolybdenum' | 'dietaryNiacin' | 'dietaryPantothenicAcid' | 'dietaryPhosphorus' | 'dietaryPotassium' | 'dietaryRiboflavin' | 'dietarySelenium' | 'dietaryThiamin' | 'dietaryVitaminA' | 'dietaryVitaminB12' | 'dietaryVitaminB6' | 'dietaryVitaminC' | 'dietaryVitaminD' | 'dietaryVitaminE' | 'dietaryVitaminK' | 'dietaryWater' | 'dietaryZinc' | 'estimatedWorkoutEffortScore' | 'physicalEffort' | 'workoutEffortScore'
SamsungPermissionTypePromps
{ types: Array<SamsungPermissionType>; }
SamsungPermissionType
'ACTIVITY_SUMMARY' | 'BLOOD_GLUCOSE' | 'BLOOD_OXYGEN' | 'BLOOD_PRESSURE' | 'BODY_COMPOSITION' | 'EXERCISE' | 'EXERCISE_LOCATION' | 'FLOORS_CLIMBED' | 'HEART_RATE' | 'NUTRITION' | 'SLEEP' | 'SLEEP_APNEA' | 'STEPS' | 'WATER_INTAKE' | 'BODY_TEMPERATURE'
RequestPermissionsStatusResult
{ result: RequestPermissionsStatus; }
RequestPermissionsStatus
'REQUEST_SENT' | 'ALREADY_GRANTED'
SyncProps
{ date?: string; types?: Array<SummaryType>; dataSource?: DataSourceType; }
SummaryType
'sleep' | 'physical' | 'body'
DataSourceType
'HEALTH_CONNECT' | 'SAMSUNG' | 'ALL'
GetDataProps
{ date: string; dataSource?: HealthKitSourceType; }
SleepSummaryResult
{ result: SleepSummary[]; }
SleepSummary
{ datetime: string; sourceOfData: string; sleepHealthScore?: number | null; sleepStartDatetime: string; sleepEndDatetime: string; sleepDate: string; sleepDurationSeconds?: number | null; timeInBedSeconds?: number | null; lightSleepDurationSeconds?: number | null; remSleepDurationSeconds?: number | null; deepSleepDurationSeconds?: number | null; timeToFallAsleepSeconds?: number | null; timeAwakeDuringSleepSeconds?: number | null; sleepQualityRating1_5_Score?: number | null; sleepEfficiency1_100_Score?: number | null; sleepGoalSeconds?: number | null; sleepContinuity1_5_Score?: number | null; sleepContinuity1_5_Rating?: number | null; hrMaxBPM?: number | null; hrMinimumBPM?: number | null; hrAvgBPM?: number | null; hrRestingBPM?: number | null; hrBasalBPM?: number | null; hrGranularDataBPM?: HeartRateGranular[] | null; hrvAvgRmssdNumber?: number | null; hrvAvgSdnnNumber?: number | null; hrvSdnnGranularData?: HRVSDNNGranular[] | null; hrvRmssdGranularData?: HRVRmssdGranular[] | null; temperatureMinimumCelsius?: Temperature | null; temperatureAvgCelsius?: Temperature | null; temperatureMaxCelsius?: Temperature | null; temperatureGranularDataCelsius?: TemperatureGranular[] | null; temperatureDeltaCelsius?: Temperature[] | null; breathsMinimumPerMin?: number | null; breathsAvgPerMin?: number | null; breathsMaxPerMin?: number | null; breathingGranularDataBreathsPerMin?: BreatingGranular[] | null; snoringEventsCountNumber?: number | null; snoringDurationTotalSeconds?: number | null; snoringGranularDataSnores?: SnoringGranular[] | null; saturationAvgPercentage?: number | null; saturationGranularDataPercentage?: SaturationGranular[] | null; saturationMinPercentage?: number | null; saturationMaxPercentage?: number | null; apneaEvents?: ApneaEvent[] | null; sleepSamples?: SleepZoneSample[] | null; maxWristTemperature?: number | null; minWristTemperature?: number | null; averageWristTemperature?: number | null; granularWristTemperatureData?: AppleWristTemperatureSample[] | null; }
HeartRateGranular
{ dateTime: String; hrBPM: number; }
HRVSDNNGranular
{ dateTime: String; hrvSDNN: number; }
HRVRmssdGranular
{ dateTime: String; hrvRmssd: number; }
Temperature
{ temperatureCelsius: number; measurementType: string; }
TemperatureGranular
{ dateTime: string; temperatureCelsius: number; measurementType: number; }
BreatingGranular
{ dateTime: string; breathsPerMin: number; }
SnoringGranular
{ dateTime: string; intervalDurationSeconds: number; snoringEventsCountNumber: number; }
SaturationGranular
{ dateTime: string; saturationPercentage: number; }
ApneaEvent
{ startDate: string; endDate: string; duration: number; appleValue: number; }
SleepZoneSample
{ startDate: string; endDate: string; duration: number; zone: number; }
AppleWristTemperatureSample
{ startDate: string endDate: string value: number }
PhysicalSummaryResult
{ result: PhysicalSummary; }
PhysicalSummary
{ dateTime: string; physicalHealthScore?: number | null; stepsPerDayNumber?: number | null; stepsGranularDataStepsPerHr?: StepsGranular[] | null; activeStepsPerDayNumber?: number | null; activeStepsGranularDataStepsPerHr?: StepsGranular[] | null; walkedDistanceMeters?: number | null; traveledDistanceMeters?: number | null; cyclingDistanceMeters?: number | null; traveledDistanceGranularDataMeters?: TraveledDistanceGranular[] | null; floorsClimbedNumber?: number | null; floorsClimbedGranularDataFloors?: FloorsClimbedGranular[] | null; elevationAvgAltitudeMeters?: number | null; elevationMinimumAltitudeMeters?: number | null; elevationMaxAltitudeMeters?: number | null; elevationLossActualAltitudeMeters?: number | null; elevationGainActualAltitudeMeters?: number | null; elevationPlannedGainMeters?: number | null; elevationGranularDataMeters?: ElevationGranular[] | null; swimmingStrokesNumber?: number | null; swimmingNumLapsNumber?: number | null; swimmingPoolLengthMeters?: number | null; swimmingTotalDistanceMeters?: number | null; swimmingDistanceGranularDataMeters?: SwimmingDistanceGranular[] | null; saturationAvgPercentage?: number | null; saturationGranularDataPercentage?: SaturationGranular[] | null; vo2MaxMlPerMinPerKg?: number | null; vo2GranularDataLiterPerMin?: Vo2Granular[] | null; activeSeconds?: number | null; restSeconds?: number | null; lowIntensitySeconds?: number | null; moderateIntensitySeconds?: number | null; vigorousIntensitySeconds?: number | null; inactivitySeconds?: number | null; continuousInactivePeriodsNumber?: number | null; activityLevelGranularDataNumber?: ActivityLevelGranularData[] | null; caloriesNetIntakeKilocalories?: number | null; caloriesExpenditureKilocalories?: number | null; caloriesNetActiveKilocalories?: number | null; caloriesBasalMetabolicRateKilocalories?: number | null; hrMaxBPM?: number | null; hrMinimumBPM?: number | null; hrAvgBPM?: number | null; hrRestingBPM?: number | null; hrGranularDataBPM?: HeartRateGranular[] | null; hrvAvgRmssdNumber?: number | null; hrvAvgSdnnNumber?: number | null; hrvSdnnGranularDataNumber?: HRVSDNNGranular[] | null; hrvRmssdGranularDataNumber?: HRVRmssdGranular[] | null; stressAtRESTDurationSeconds?: number | null; stressDurationSeconds?: number | null; lowStressDurationSeconds?: number | null; mediumStressDurationSeconds?: number | null; highStressDurationSeconds?: number | null; stressGranularDataScoreNumber?: StressGranular[] | null; stressAvgLevelNumber?: number | null; stressMaxLevelNumber?: number | null; walkingSpeed?: number | null; walkingStepLength?: number | null; runningPower?: number | null; runningSpeed?: number | null; }
StepsGranular
{ dateTime: string intervalDurationSeconds: number steps: number }
TraveledDistanceGranular
{ dateTime: string intervalDurationSeconds: number traveledDistanceMeters: number }
FloorsClimbedGranular
{ dateTime: string intervalDurationSeconds: number floorsClimbed: number }
ElevationGranular
{ dateTime: string intervalDurationSeconds: number elevationChange: number }
SwimmingDistanceGranular
{ dateTime: string intervalDurationSeconds: number swimmingDistanceMeters: number }
Vo2Granular
{ dateTime: string vo2MlPerMinPerKg: number }
ActivityLevelGranularData
{ dateTime: string activityLevel: number }
StressGranular
{ dateTime: string stressScore: number }
BodySummaryResult
{ result: BodySummary; }
BodySummary
{ dateTime: string; bodyHealthScore?: number | null; waistCircumferenceCMNumber?: number | null; hipCircumferenceCMNumber?: number | null; chestCircumferenceCMNumber?: number | null; boneCompositionPercentageNumber?: number | null; muscleCompositionPercentageNumber?: number | null; waterCompositionPercentageNumber?: number | null; weightKgNumber?: number | null; heightCMNumber?: number | null; bmiNumber?: number | null; bloodGlucoseDayAvgMgPerDLNumber?: number | null; bloodGlucoseGranularDataMgPerDL?: BloodGlucoseGranular[] | null; bloodPressureDayAvgSystolicDiastolicBpNumber?: BloodPressureSystolicDiastolic | null; bloodPressureGranularDataSystolicDiastolicBpNumber?: BloodPressureGranularSystolicDiastolicBp[] | null; waterTotalConsumptionMlNumber?: number | null; hydrationAmountGranularDataMlNumber?: HydrationAmountGranular[] | null; hydrationLevelGranularDataPercentageNumber?: HydrationLevelGranular[] | null; hrMaxBPM?: number | null; hrMinimumBPM?: number | null; hrAvgBPM?: number | null; hrRestingBPM?: number | null; hrGranularDataBPM?: HeartRateGranular[] | null; hrvAvgRmssdNumber?: number | null; hrvAvgSdnnNumber?: number | null; hrvSdnnGranularDataNumber?: HRVSDNNGranular[] | null; hrvRmssdGranularDataNumber?: HRVRmssdGranular[] | null; moodMinimumScale?: number | null; moodAvgScale?: number | null; moodGranularDataScale?: MoodGranular[] | null; moodMaxScale?: number | null; moodDeltaScale?: number | null; foodIntakeNumber?: number | null; caloriesIntakeNumber?: number | null; proteinIntakeGNumber?: number | null; sugarIntakeGNumber?: number | null; fatIntakeGNumber?: number | null; transFatIntakeGNumber?: number | null; carbohydratesIntakeGNumber?: number | null; fiberIntakeGNumber?: number | null; alcoholIntakeGNumber?: number | null; sodiumIntakeMgNumber?: number | null; cholesterolIntakeMgNumber?: number | null; saturationAvgPercentage?: number | null; saturationGranularDataPercentage?: SaturationGranular[] | null; vo2MaxMlPerMinPerKg?: number | null; vo2GranularDataLiterPerMin?: Vo2Granular[] | null; temperatureMinimumCelsius?: Temperature | null; temperatureAvgCelsius?: Temperature | null; temperatureMaxCelsius?: Temperature | null; temperatureDeltaCelsius?: Temperature | null; temperatureGranularDataCelsius?: TemperatureGranular[] | null; uvExposureMax?: number | null; uvExposureAvg?: number | null; uvExposureMin?: number | null; uvExposureSeconds?: number | null; }
BloodGlucoseGranular
{ dateTime: string; bloodGlucoseMgPerDL: number; }
BloodPressureSystolicDiastolic
{ systolicBp: number; diastolicBp: number; }
BloodPressureGranularSystolicDiastolicBp
{ dateTime: string; systolicBp: number; diastolicBp: number; }
HydrationAmountGranular
{ dateTime: string; intervalDurationSeconds: number; hydrationAmountMl: number; }
HydrationLevelGranular
{ dateTime: string; intervalDurationSeconds: number; hydrationLevelPercentage: number; }
MoodGranular
{ dateTime: string; intervalDurationSeconds: number; moodScale: number; }
SyncEventProps
{ date: string; type: EventType; dataSource?: DataSourceType; }
EventType
'activity' | 'heart_rate' | 'oxygenation' | 'temperature' | 'blood_pressure' | 'blood_glucose' | 'calories' | 'hydration' | 'nutrition' | 'steps' | 'body_metrics' | 'ecg'
ActivityEventResult
{ result: ActivityEvent[]; }
ActivityEvent
{ dateTime: string; sourcesOfData: number; activityStartTimeDateTime: string; activityEndTimeDateTime: string; activityDurationSeconds?: number | null; activityTypeName?: number | null; activeSeconds?: number | null; restSeconds?: number | null; lowIntensitySeconds?: number | null; moderateIntensitySeconds?: number | null; vigorousIntensitySeconds?: number | null; inactivitySeconds?: number | null; activityLevelGranularDataNumber?: ActivityLevelGranularData[] | null; continuousInactivePeriodsNumber?: number | null; activityStrainLevelNumber?: number | null; activityWorkKilojoules?: number | null; activityEnergyKilojoules?: number | null; activityEnergyPlannedKilojoules?: number | null; caloriesNetIntakeKilocalories?: number | null; caloriesExpenditureKilocalories?: number | null; caloriesNetActiveKilocalories?: number | null; caloriesBasalMetabolicRateKilocalories?: number | null; fatPercentageOfCaloriesPercentage?: number | null; carbohydratePercentageOfCaloriesPercentage?: number | null; proteinPercentageOfCaloriesPercentage?: number | null; stepsNumber?: number | null; stepsGranularDataStepsPerMin?: StepsGranular[] | null; walkedDistanceMeters?: number | null; traveledDistanceMeters?: number | null; traveledDistanceGranularDataMeters?: TraveledDistanceGranular[] | null; floorsClimbedNumber?: number | null; floorsClimbedGranularDataFloorsNumber?: FloorsClimbedGranular[] | null; elevationAvgAltitudeMeters?: number | null; elevationMinimumAltitudeMeters?: number | null; elevationMaxAltitudeMeters?: number | null; elevationLossActualAltitudeMeters?: number | null; elevationGainActualAltitudeMeters?: number | null; elevationPlannedGainMeters?: number | null; elevationGranularDataMeters?: ElevationGranular[] | null; swimmingNumStrokesNumber?: number | null; swimmingNumLapsNumber?: number | null; swimmingPoolLengthMeters?: number | null; swimmingTotalDistanceMeters?: number | null; swimmingDistanceGranularDataMeters?: SwimmingDistanceGranular[] | null; hrMaxBPM?: number | null; hrMinimumBPM?: number | null; hrAvgBPM?: number | null; hrRestingBPM?: number | null; hrGranularDataBPM?: HeartRateGranular[] | null; hrvAvgRmssdNumber?: number | null; hrvAvgSdnnNumber?: number | null; hrvSdnnGranularDataNumber?: HRVSDNNGranular[] | null; hrvRmssdGranularDataNumber?: HRVRmssdGranular[] | null; speedNormalizedMetersPerSecond?: number | null; speedAvgMetersPerSecond?: number | null; speedMaxMetersPerSecond?: number | null; speedGranularDataMetersPerSecond?: SpeedGranular[] | null; velocityVectorAvgSpeedAndDirection?: VelocityVectorSpeed | null; velocityVectorMaxSpeedAndDirection?: VelocityVectorSpeed | null; paceAvgMinutesPerKilometer?: number | null; paceMaxMinutesPerKilometer?: number | null; cadenceAvgRPM?: number | null; cadenceMaxRPM?: number | null; cadenceGranularDataRPM?: CadenceGranular[] | null; torqueAvgNewtonMeters?: number | null; torqueMaxNewtonMeters?: number | null; torqueGranularDataNewtonMeters?: TorqueGranular[] | null; lapGranularDataLapsNumber?: LapGranular[] | null; powerAvgWattsNumber?: number | null; powerMaxWattsNumber?: number | null; powerGranularDataWattsNumber?: PowerGranular[] | null; positionStartLatLngDeg?: PositionLatLng | null; positionCentroidLatLngDeg?: PositionLatLng | null; positionEndLatLngDeg?: PositionLatLng | null; positionGranularDataLatLngDeg?: PositionGranular[] | null; positionPolylineMapDataSummaryString?: string | null; saturationAvgPercentage?: number | null; saturationGranularDataPercentage?: SaturationGranular[] | null; vo2MaxMlPerMinPerKg?: number | null; vo2GranularDataMlPerMin?: Vo2Granular[] | null; stressAtRESTDurationSeconds?: number | null; stressDurationSeconds?: number | null; lowStressDurationSeconds?: number | null; mediumStressDurationSeconds?: number | null; highStressDurationSeconds?: number | null; tssGranularData1_500_ScoreNumber?: TssGranular[] | null; stressAvgLevelNumber?: number | null; stressMaxLevelNumber?: number | null; appleWorkoutIdentifier?: string | null; appleDistanceCyclingMeters?: number | null; }
SpeedGranular
{ dateTime: string; intervalDurationSeconds: number; speedMetersPerSecond: number; }
VelocityVectorSpeed
{ speedMetersPerSecond: number; direction: string; }
CadenceGranular
{ dateTime: string; intervalDurationSeconds: number; cadenceRPM: number; }
TorqueGranular
{ dateTime: string; intervalDurationSeconds: number; torqueNewtonMeters: number; }
LapGranular
{ dateTime: string; intervalDurationSeconds: number; laps: number; }
PowerGranular
{ dateTime: string; intervalDurationSeconds: number; powerWatts: number; }
PositionLatLng
{ lat: number lng: number }
PositionGranular
{ dateTime: string; intervalDurationSeconds: number; lat: number; lng: number; }
TssGranular
{ dateTime: string; intervalDurationSeconds: number; tss1_500_Score: number; }
TodayPromps
{ source: EventDataSourceType; }
EventDataSourceType
'HEALTH_CONNECT' | 'SAMSUNG'
StepsResult
{ stepCount: number; }
CaloriesResult
{ basal: number; active: number; }
HeartRateResult
{ result: HeartRateData; }
HeartRateData
{ hrMaximumBPM?: number | null; hrMinimumBPM?: number | null; hrAverageBPM?: number | null; hrRestingBPM?: number | null; hrvAverageRMSSD?: number | null; hrvAverageSDNN?: number | null; hrGranularData?: HeartRateGranular[] | null; hrvSDNNGranularData?: HRVSDNNGranular[] | null; hrvRMSSDGranularData?: HRVRmssdGranular[] | null; }
DataSourceProps
{ redirectURL?: string; }
ResultDataSource
{ result: DataSource[]; }
DataSource
{ name: string; authorizationURL: string; imageUrl: string; description: string; connected: boolean; }
DataSourcesProps
{ userId?: string }
ResultStatusDataSources
{ result: DataSourceStatus[]; }
DataSourceStatus
{ source: string; status: boolean; imageUrl: string; }
DataSourceAuthorizerProps
{ source: string; redirectUrl?: string; userId?: string }
ResultDataSourceDetails
{ dataSource: string; authorized: boolean; authorizationUrl?: string; }
RevokeDataSourceProps
{ dataSource: DataSourceRevoke; userId?: string; }
DataSourceRevoke
'Garmin' | 'Oura' | 'Polar' | 'Fitbit' | 'Withings' | 'Dexcom' | 'Whoop'
