sahha-capacitor

Sahha Capacitor SDK


Keywords
capacitor, plugin, native
License
DSDP
Install
npm install sahha-capacitor@0.0.4

Documentation

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; }>
Param Type
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; }>
Param Type
options { appId: string; appSecret: string; externalId: string; }

Returns: Promise<{ success: boolean; }>


authenticateToken(...)

authenticateToken(options: { profileToken: string; refreshToken: string; }) => Promise<{ success: boolean; }>
Param Type
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; }>
Param Type
options { demographic: SahhaDemographic; }

Returns: Promise<{ success: boolean; }>


getSensorStatus(...)

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

Returns: Promise<{ status: SahhaSensorStatus; }>


enableSensors(...)

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

Returns: Promise<{ status: SahhaSensorStatus; }>


getScores(...)

getScores(options: { types: SahhaScoreType[]; startDateTime: number; endDateTime: number; }) => Promise<{ value: string; }>
Param Type
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; }>
Param Type
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; }>
Param Type
options { sensor: SahhaSensor; startDateTime: number; endDateTime: number; }

Returns: Promise<{ value: string; }>


getSamples(...)

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

Returns: Promise<{ value: string; }>


openAppSettings()

openAppSettings() => Promise<void>

Interfaces

SahhaSettings

Prop Type
environment SahhaEnvironment
sensors SahhaSensor[]
notificationSettings { icon?: string; title?: string; shortDescription?: string; }

SahhaDemographic

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

Enums

SahhaEnvironment

Members Value
sandbox 'sandbox'
production 'production'

SahhaSensor

Members Value
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

Members Value
pending 0
unavailable 1
disabled 2
enabled 3

SahhaScoreType

Members Value
wellbeing 'wellbeing'
activity 'activity'
sleep 'sleep'
readiness 'readiness'
mental_wellbeing 'mental_wellbeing'

SahhaBiomarkerCategory

Members Value
activity 'activity'
body 'body'
characteristic 'characteristic'
reproductive 'reproductive'
sleep 'sleep'
vitals 'vitals'

SahhaBiomarkerType

Members Value
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.