The Sahha SDK provides a convenient way for Ionic / Capacitor apps to connect to the Sahha API.
The Sahha Docs provide detailed instructions for installation and usage of the Sahha SDK.
The Sahha Demo App provides a convenient way to try the features of the Sahha SDK.
npm install sahha-capacitor
npx cap sync
configure(...)
isAuthenticated()
authenticate(...)
authenticateToken(...)
deauthenticate()
getProfileToken()
getDemographic()
postDemographic(...)
getSensorStatus(...)
enableSensors(...)
openAppSettings()
- Interfaces
- Enums
configure(options: { settings: SahhaSettings; }) => Promise<{ success: boolean; }>
Param | Type |
---|---|
options |
{ settings: SahhaSettings; } |
Returns: Promise<{ success: boolean; }>
isAuthenticated() => Promise<{ success: boolean; }>
Returns: Promise<{ success: boolean; }>
authenticate(options: { appId: string; appSecret: string; externalId: string; }) => Promise<{ success: boolean; }>
Param | Type |
---|---|
options |
{ appId: string; appSecret: string; externalId: string; } |
Returns: Promise<{ success: boolean; }>
authenticateToken(options: { profileToken: string; refreshToken: string; }) => Promise<{ success: boolean; }>
Param | Type |
---|---|
options |
{ profileToken: string; refreshToken: string; } |
Returns: Promise<{ success: boolean; }>
deauthenticate() => Promise<{ success: boolean; }>
Returns: Promise<{ success: boolean; }>
getProfileToken() => Promise<{ profileToken?: string; }>
Returns: Promise<{ profileToken?: string; }>
getDemographic() => Promise<{ demographic?: string; }>
Returns: Promise<{ demographic?: string; }>
postDemographic(options: { demographic: SahhaDemographic; }) => Promise<{ success: boolean; }>
Param | Type |
---|---|
options |
{ demographic: SahhaDemographic; } |
Returns: Promise<{ success: boolean; }>
getSensorStatus(options: { sensors: SahhaSensor[]; }) => Promise<{ status: SahhaSensorStatus; }>
Param | Type |
---|---|
options |
{ sensors: SahhaSensor[]; } |
Returns: Promise<{ status: SahhaSensorStatus; }>
enableSensors(options: { sensors: SahhaSensor[]; }) => Promise<{ status: SahhaSensorStatus; }>
Param | Type |
---|---|
options |
{ sensors: SahhaSensor[]; } |
Returns: Promise<{ status: SahhaSensorStatus; }>
openAppSettings() => Promise<void>
Prop | Type |
---|---|
environment |
SahhaEnvironment |
sensors |
SahhaSensor[] |
notificationSettings |
{ icon?: string; title?: string; shortDescription?: string; } |
Prop | Type |
---|---|
age |
number |
gender |
string |
country |
string |
birthCountry |
string |
ethnicity |
string |
occupation |
string |
industry |
string |
incomeRange |
string |
education |
string |
relationship |
string |
locale |
string |
livingArrangement |
string |
birthDate |
string |
Members | Value |
---|---|
sandbox |
'sandbox' |
production |
'production' |
Members | Value |
---|---|
gender |
'gender' |
date_of_birth |
'date_of_birth' |
sleep |
'sleep' |
step_count |
'step_count' |
floor_count |
'floor_count' |
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' |
Members | Value |
---|---|
pending |
0 |
unavailable |
1 |
disabled |
2 |
enabled |
3 |
Copyright © 2024 Sahha. All rights reserved.