sahha-capacitor
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

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; }>


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'
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'

SahhaSensorStatus

Members Value
pending 0
unavailable 1
disabled 2
enabled 3

Copyright © 2024 Sahha. All rights reserved.

Readme

Keywords

Package Sidebar

Install

npm i sahha-capacitor

Weekly Downloads

3

Version

1.0.3

License

Sahha SDK License

Unpacked Size

101 kB

Total Files

24

Last publish

Collaborators

  • min-sahha
  • matt_sahha