sahha-capacitor
Sahha Cordova Plugin
Install
npm install sahha-capacitor
npx cap sync
API
configure(...)
authenticate(...)
getDemographic()
postDemographic(...)
getSensorStatus()
enableSensors()
postSensorData()
analyze(...)
openAppSettings()
- Interfaces
- Enums
configure(...)
configure(options: { settings: SahhaSettings; }) => Promise<{ success: boolean; }>
Param | Type |
---|---|
options |
{ settings: SahhaSettings; } |
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; }>
getDemographic()
getDemographic() => Promise<{ value: string; }>
Returns: Promise<{ value: string; }>
postDemographic(...)
postDemographic(options: { demographic: SahhaDemographic; }) => Promise<{ success: boolean; }>
Param | Type |
---|---|
options |
{ demographic: SahhaDemographic; } |
Returns: Promise<{ success: boolean; }>
getSensorStatus()
getSensorStatus() => Promise<{ status: SahhaSensorStatus; }>
Returns: Promise<{ status: SahhaSensorStatus; }>
enableSensors()
enableSensors() => Promise<{ status: SahhaSensorStatus; }>
Returns: Promise<{ status: SahhaSensorStatus; }>
postSensorData()
postSensorData() => Promise<{ success: boolean; }>
Returns: Promise<{ success: boolean; }>
analyze(...)
analyze(options?: { startDate?: number | undefined; endDate?: number | undefined; } | undefined) => Promise<{ value: string; }>
Param | Type |
---|---|
options |
{ startDate?: number; endDate?: 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 |
Enums
SahhaEnvironment
Members | Value |
---|---|
development |
'development' |
production |
'production' |
SahhaSensor
Members | Value |
---|---|
sleep |
'sleep' |
pedometer |
'pedometer' |
device |
'device' |
heart |
'heart' |
blood |
'blood' |
SahhaSensorStatus
Members | Value |
---|---|
pending |
0 |
unavailable |
1 |
disabled |
2 |
enabled |
3 |