1.1.4 • Published 5 months ago

sahha-capacitor v1.1.4

Weekly downloads
-
License
Sahha SDK License
Repository
github
Last release
5 months ago

Sahha Capacitor SDK

The Sahha SDK provides a convenient way for Ionic / Capacitor apps to connect to the Sahha API.


Docs

The Sahha Docs provide detailed instructions for installation and usage of the Sahha SDK.

Sahha Docs


Example

The Sahha Demo App provides a convenient way to try the features of the Sahha SDK.

Sahha Demo App


Install

npm install sahha-capacitor
npx cap sync

API

configure(...)

configure(options: { settings: SahhaSettings; }) => Promise<{ success: boolean; }>
ParamType
options{ settings: SahhaSettings; }

Returns: Promise<{ success: boolean; }>


isAuthenticated()

isAuthenticated() => Promise<{ success: boolean; }>

Returns: Promise<{ success: boolean; }>


authenticate(...)

authenticate(options: { appId: string; appSecret: string; externalId: string; }) => Promise<{ success: boolean; }>
ParamType
options{ appId: string; appSecret: string; externalId: string; }

Returns: Promise<{ success: boolean; }>


authenticateToken(...)

authenticateToken(options: { profileToken: string; refreshToken: string; }) => Promise<{ success: boolean; }>
ParamType
options{ profileToken: string; refreshToken: string; }

Returns: Promise<{ success: boolean; }>


deauthenticate()

deauthenticate() => Promise<{ success: boolean; }>

Returns: Promise<{ success: boolean; }>


getProfileToken()

getProfileToken() => Promise<{ profileToken?: string; }>

Returns: Promise<{ profileToken?: string; }>


getDemographic()

getDemographic() => Promise<{ demographic?: string; }>

Returns: Promise<{ demographic?: string; }>


postDemographic(...)

postDemographic(options: { demographic: SahhaDemographic; }) => Promise<{ success: boolean; }>
ParamType
options{ demographic: SahhaDemographic; }

Returns: Promise<{ success: boolean; }>


getSensorStatus(...)

getSensorStatus(options: { sensors: SahhaSensor[]; }) => Promise<{ status: SahhaSensorStatus; }>
ParamType
options{ sensors: SahhaSensor[]; }

Returns: Promise<{ status: SahhaSensorStatus; }>


enableSensors(...)

enableSensors(options: { sensors: SahhaSensor[]; }) => Promise<{ status: SahhaSensorStatus; }>
ParamType
options{ sensors: SahhaSensor[]; }

Returns: Promise<{ status: SahhaSensorStatus; }>


getScores(...)

getScores(options: { types: SahhaScoreType[]; startDateTime: number; endDateTime: number; }) => Promise<{ value: string; }>
ParamType
options{ types: SahhaScoreType[]; startDateTime: number; endDateTime: number; }

Returns: Promise<{ value: string; }>


getBiomarkers(...)

getBiomarkers(options: { categories: SahhaBiomarkerCategory[]; types: SahhaBiomarkerType[]; startDateTime: number; endDateTime: number; }) => Promise<{ value: string; }>
ParamType
options{ categories: SahhaBiomarkerCategory[]; types: SahhaBiomarkerType[]; startDateTime: number; endDateTime: number; }

Returns: Promise<{ value: string; }>


getStats(...)

getStats(options: { sensor: SahhaSensor; startDateTime: number; endDateTime: number; }) => Promise<{ value: string; }>
ParamType
options{ sensor: SahhaSensor; startDateTime: number; endDateTime: number; }

Returns: Promise<{ value: string; }>


getSamples(...)

getSamples(options: { sensor: SahhaSensor; startDateTime: number; endDateTime: number; }) => Promise<{ value: string; }>
ParamType
options{ sensor: SahhaSensor; startDateTime: number; endDateTime: number; }

Returns: Promise<{ value: string; }>


openAppSettings()

openAppSettings() => Promise<void>

Interfaces

SahhaSettings

PropType
environmentSahhaEnvironment
sensorsSahhaSensor[]
notificationSettings{ icon?: string; title?: string; shortDescription?: string; }

SahhaDemographic

PropType
agenumber
genderstring
countrystring
birthCountrystring
ethnicitystring
occupationstring
industrystring
incomeRangestring
educationstring
relationshipstring
localestring
livingArrangementstring
birthDatestring

Enums

SahhaEnvironment

MembersValue
sandbox'sandbox'
production'production'

SahhaSensor

MembersValue
gender'gender'
date_of_birth'date_of_birth'
sleep'sleep'
steps'steps'
floors_climbed'floors_climbed'
heart_rate'heart_rate'
resting_heart_rate'resting_heart_rate'
walking_heart_rate_average'walking_heart_rate_average'
heart_rate_variability_sdnn'heart_rate_variability_sdnn'
heart_rate_variability_rmssd'heart_rate_variability_rmssd'
blood_pressure_systolic'blood_pressure_systolic'
blood_pressure_diastolic'blood_pressure_diastolic'
blood_glucose'blood_glucose'
vo2_max'vo2_max'
oxygen_saturation'oxygen_saturation'
respiratory_rate'respiratory_rate'
active_energy_burned'active_energy_burned'
basal_energy_burned'basal_energy_burned'
total_energy_burned'total_energy_burned'
basal_metabolic_rate'basal_metabolic_rate'
time_in_daylight'time_in_daylight'
body_temperature'body_temperature'
basal_body_temperature'basal_body_temperature'
sleeping_wrist_temperature'sleeping_wrist_temperature'
height'height'
weight'weight'
lean_body_mass'lean_body_mass'
body_mass_index'body_mass_index'
body_fat'body_fat'
body_water_mass'body_water_mass'
bone_mass'bone_mass'
waist_circumference'waist_circumference'
stand_time'stand_time'
move_time'move_time'
exercise_time'exercise_time'
activity_summary'activity_summary'
device_lock'device_lock'
exercise'exercise'

SahhaSensorStatus

MembersValue
pending0
unavailable1
disabled2
enabled3

SahhaScoreType

MembersValue
wellbeing'wellbeing'
activity'activity'
sleep'sleep'
readiness'readiness'
mental_wellbeing'mental_wellbeing'

SahhaBiomarkerCategory

MembersValue
activity'activity'
body'body'
characteristic'characteristic'
reproductive'reproductive'
sleep'sleep'
vitals'vitals'

SahhaBiomarkerType

MembersValue
steps'steps'
floors_climbed'floors_climbed'
active_hours'active_hours'
active_duration'active_duration'
activity_low_intensity_duration'activity_low_intensity_duration'
activity_mid_intensity_duration'activity_mid_intensity_duration'
activity_high_intensity_duration'activity_high_intensity_duration'
activity_sedentary_duration'activity_sedentary_duration'
active_energy_burned'active_energy_burned'
total_energy_burned'total_energy_burned'
height'height'
weight'weight'
body_mass_index'body_mass_index'
body_fat'body_fat'
fat_mass'fat_mass'
lean_mass'lean_mass'
waist_circumference'waist_circumference'
resting_energy_burned'resting_energy_burned'
age'age'
biological_sex'biological_sex'
date_of_birth'date_of_birth'
menstrual_cycle_length'menstrual_cycle_length'
menstrual_cycle_start_date'menstrual_cycle_start_date'
menstrual_cycle_end_date'menstrual_cycle_end_date'
menstrual_phase'menstrual_phase'
menstrual_phase_start_date'menstrual_phase_start_date'
menstrual_phase_end_date'menstrual_phase_end_date'
menstrual_phase_length'menstrual_phase_length'
sleep_start_time'sleep_start_time'
sleep_end_time'sleep_end_time'
sleep_duration'sleep_duration'
sleep_debt'sleep_debt'
sleep_interruptions'sleep_interruptions'
sleep_in_bed_duration'sleep_in_bed_duration'
sleep_awake_duration'sleep_awake_duration'
sleep_light_duration'sleep_light_duration'
sleep_rem_duration'sleep_rem_duration'
sleep_deep_duration'sleep_deep_duration'
sleep_regularity'sleep_regularity'
sleep_latency'sleep_latency'
sleep_efficiency'sleep_efficiency'
heart_rate_resting'heart_rate_resting'
heart_rate_sleep'heart_rate_sleep'
heart_rate_variability_sdnn'heart_rate_variability_sdnn'
heart_rate_variability_rmssd'heart_rate_variability_rmssd'
respiratory_rate'respiratory_rate'
respiratory_rate_sleep'respiratory_rate_sleep'
oxygen_saturation'oxygen_saturation'
oxygen_saturation_sleep'oxygen_saturation_sleep'
vo2_max'vo2_max'
blood_glucose'blood_glucose'
blood_pressure_systolic'blood_pressure_systolic'
blood_pressure_diastolic'blood_pressure_diastolic'
body_temperature_basal'body_temperature_basal'
skin_temperature_sleep'skin_temperature_sleep'

Copyright © 2024 Sahha. All rights reserved.

1.1.1

6 months ago

1.1.0

6 months ago

1.0.9

7 months ago

1.1.4

5 months ago

1.0.3

9 months ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.4

2 years ago

0.1.5

2 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago